How to detect ProMotion VRR on iOS

There was a good 2021 WWDC presentation on using ProMotion on iOS, and using Adaptive Sync (ProMotion) on macOS. But while the macOS presentation showed how to detect ProMotion (fullscreen + min/maxInterval mismatch). The iOS side doesn't have this same mechanism. The talk mentions Metal sample code for the talk, but I don't see ProMotion mentioned anywhere in the Metal samples when I do search.


Also have an iOS app using running atop a Macbook Pro M2 with ProMotion. So here again, I assume I need to detect fullscreen setting and whether ProMotion is present but from the iOS side. But IOS doesn't seem to have these APIs and there's nothing in the docs or WWDC talk about detection.

Also frustrating that sysctl(HW, HW_MODEL) works on macOS running iOS (but not for iOS), but sysctl(HW, HW_MACHINE) returns the wrong value. HW_MACHINE returns that the M2 is an iPad8,6. Apple really needs to release sample code to better support this, and any sample for ProMotion on both platforms included detection code.

For lack of anything better, I'll assume detecting ProMotion on iOS is UIScreen.maximumRefreshRate > 80. But I'd like to know I have ProMotion even when it's throttled to 60Hz.

Also seems that there is no detect for the "fullscreen" hack of running iOS app on macOS. The app starts up at the full res of the display, and stays that resolution even when you drop out of fullscreen mode (fn+F). The windowed mode can't really be resized, so this must be the tradeoff for this mode, and it beats adopting MacCatalyst.

So we're rendering a lot more pixels than needed in windowed mode, and can't tell fullscreen vs. not by comparing the UIScreen rect and UIView size. Maybe I can test the UIWindow size instead, since that seems smaller than the view res in this case.

I'll probably have to submit this as a precious ticket to get any response to these issues.

The fullscreen requirement for iOS on macOS is if an app doesn't support all orientations and multitasking. It's a little weird to have the windowed and fullscreen render the same dimensions, since it means text is unreadable in our app when windowed, and there is downscaling of the pixels. So I'll see if we can disable that so that we get a resizable window. But all the remaining issues above still need solutions.