I am curious about when showsFields
is turned on, the memory usage increase extremely fast? It can growth up to 500MB under 30 seconds. If my mac only have 8GB of RAM, I probably have less than 8 minutes to debug before memory warning, it will be worst when debug on real device.
The screenshot below is tested from a real device (iOS 9.2).
You can quickly try it by creating a SpriteKit project and turn showsFields
on in viewDidLoad()
method inside the view controller.
skView.showsFields = true
If you want to see what showsFields
does, place this snippet inside the scene's -didMoveToView(view:)
method.
override func didMoveToView(view: SKView) {
let myField = SKFieldNode.springField()
myField.position = CGPointMake(frame.midX, frame.midY)
myField.strength = 1.0
self.addChild(myField)
}
Here is showsFields
discussion from Apple
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.