r/swift•
twentyoneog

SpriteKit - Issue with 120 FPS/Hz

Help!

I have a weird SpriteKit issue and hope someone can help me out. I tried to refactor my old Swift game and started with a new blank project. I decided to use SwiftUI in combination with SpriteKit and wrapped it inside a SpriteView. I went to Apples Docs (https://developer.apple.com/documentation/quartzcore/optimizing_promotion_refresh_rates_for_iphone_13_pro_and_ipad_pro) tried everything like editing the Info.plist file, adding the .preferredFramesPerSecond = 120, also tried the display link which got described in this documentation, but nothing works. Every time my sample animation has 60 FPS and never switch to 120 FPS. I tried everything out, I asked ChatGPT but non solution works. I also tried to do it only with UIKit and SpriteKit (and no SwiftUI), but same issue.
Does anyone has experience with that? What is the issue?
Of course I'm testing my app on a real device which supports promotion (iPhone 13 Pro) and it's activated/enabled.
I tried to figure this out since days but I'm very clueless right now and feeling very dumb lol.

I uploaded my example test project (where I tried to do it with UIKit (but also not working, tried same logic on swiftui)):

https://github.com/1xxn/iosbug120fps

Posted Nov 1, 2023, 3:59 PM UTC

85
Loading comments…