Why my CADisplayLink runs at low framerate, but UIScrollView doesn't?

I have a tiny iOS app project set up.

I instantiate a CADisplayLink and then log the time that passes between its calls to target-action. This is on an iPhone 15 Pro, so 120 hertz. However, I am observing that in user space, the actual tick rate of my target-action being called is actually fluctuating around 70-80 hertz.

But then, I instantiate a UIScrollView and give it a delegate. In the delegate I am observing that scrollViewDidScroll gets called with the correct 120 hz. And if I set a breakpoint inside scrollViewDidScroll, I can see that this is called from a CADisplayLink handler inside UIScrollView. How comes they can have 120hz, and I don't?

Of course, I did set UIScreen.maximumFramesPerSecond to preferredFramerateRange, minimum, maximum and preferred. Also, I don no virtually no work in the handler - I am just setting UIView.transform = CGAffineTransform(translationY: 100).

Also, my info.plist does indeed contain <key>CADisableMinimumFrameDurationOnPhone</key><true/>

Answered by DTS Engineer in 847871022

Maybe do some profiling to determine how long your target function is taking to execute. If your function takes longer than the allocated time, then calls may be skipped.

Optimizing ProMotion refresh rates for iPhone 13 Pro and iPad Pro

Maybe do some profiling to determine how long your target function is taking to execute. If your function takes longer than the allocated time, then calls may be skipped.

Optimizing ProMotion refresh rates for iPhone 13 Pro and iPad Pro

Nevermind, my Info.plist did not contain <key>CADisableMinimumFrameDurationOnPhone</key><true/>, it was misconfigured, it is all my fault.

Why my CADisplayLink runs at low framerate, but UIScrollView doesn't?
 
 
Q