开发者

Is it possible to find the refresh rate for iPhone?

开发者 https://www.devze.com 2023-03-02 01:05 出处:网络
I want to know if it is possible to find the refresh rate for the iPhone开发者_如何学C screen, programmatically. I have searched, but have found no private API available.

I want to know if it is possible to find the refresh rate for the iPhone开发者_如何学C screen, programmatically. I have searched, but have found no private API available.

Is there any way to find this out?

Thanks in advance.


I believe the iPhone screen refresh rate is fixed to 60Hz, but you can test this yourself using the CADisplayLink API which will call a selector you choose whenever the screen is updated

Use something like:

CADisplayLink *displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(update)];
[displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];


Yes, it's possible. On iOS 10.3+ you can use UIScreen.maximumFramesPerSecond to get "The maximum number of frames per second of which the screen is capable."

0

精彩评论

暂无评论...
验证码 换一张
取 消