Life is Really Short, Have Your Life!!

ござ先輩の主に技術的なメモ

PlaygroundではARCのテストコードを書いても動きませんよ

Swiftのドキュメントに書いているARCのデイニシャライザ (deinit)を呼ぼうとしたら動かなかった。

Xcode's Playgrounds for Swift don't work like regular apps; they aren't being run just once. The objects created stay in memory and can be inspected until you change the code, at which point the whole playground is reevaluated. When this happens, all previous results are discarded and while all object will be deallocated, you won't see any output from that.

Deinit method is never called - Swift playground - Stack Overflow

そりゃそうだよね。Playgroundが書かれたコードを評価する以上、PlayGroundの参照が外れることはないっていう理屈っすよね。一応、公式に書いておいてよー。