SKViewのバグ?

短いついでに、今日はまった面倒なバグも残しておきます。

SKViewshowsFieldsプロパティは、マニュアルによると物理フィールドのデバッグ情報を出力できるとのこと。

showsFields Property
A Boolean value that indicates whether the view displays information about physics fields in the scene.

var showsFields: Bool

Discussion
When this debugging option is enabled, each time a frame is rendered, an image is drawn behind your scene that shows the effects of any physics fields contained in the scene.

ところがこのプロパティをtrueにして実行すると、猛烈な勢いでメモリを消費してしまい、最終的にはメモリ不足でアプリが落ちてしまっていました。Instrumentsで見てみると、メモリリークは検知されなかったもののMetal周りでフレーム更新のたびにヒープを消費しまくっているところまで確認できました。

どうやっても回避できず、しばらくはshowsFieldsの使用を諦めるしかなさそうです。残念。

ちなみにiOS9.2、Xcode 7.2(7C68)で確認しました。将来のバージョンでは直っているかな?