Hi everyone!
I am working on a playground which uses SceneKit. For this, I am adding 54 individual spheres to the scene. On my mac everything works fine but when I use the project on my iPad it crashes. I suspect my playground runs out of memory on the iPad.
Do you know the memory limits of Swift Playgrounds on iPad?
Yours,
Max
HI everyone!
I’ve solved it! As I’ve said I was creating a lot of spheres in a for loop. The solution for me was to wrap the creation of these in a autoreleasepool:
for object in self.town!.objects.values {
autoreleasepool {
townNode.addChildNode(object.nodeForObject())
}
}I also found that the performance in Xcode and the iOS Simulator are not representative of real world device performance. While it was hard to sustain a framerate of around 12 FPS on my Macbook Pro I could easily hit 60 FPS on an iPad Air 2. Also, turning off logging in the Swift Playground Book gave me a heavy performance boost.