admin 管理员组

文章数量: 1087139

I'm working with a CADisplayLink in iOS to synchronize my rendering with the screen refresh rate. On devices running iOS 15 or later, CADisplayLink allows us to specify a preferredFrameRateRange using CAFrameRateRange(minimum:maximum:preferred:).

I'm trying to understand how to choose the best values for minimum, maximum, and preferred based on different use cases. Here's the setup I'm working with:

let displayLink = CADisplayLink(target: self, selector: #selector(render))
if #available(iOS 15.0, *) {
    displayLink.preferredFrameRateRange = CAFrameRateRange(minimum: 30, maximum: 120, preferred: 60)
} else {
    displayLink.preferredFramesPerSecond = 60
}
displayLink.add(to: .current, forMode: .default)

How should I decide on the values for minimum, maximum, and preferred?

  • For example, what values are suitable for apps that need smooth animations or high performance?

  • Is there any guidance on how these values affect ProMotion displays (like the iPhone 15 Pro Max) that dynamically adjust refresh rates?

  • Are there any specific trade-offs or best practices to consider for adaptive frame rates or energy efficiency?

本文标签:

Error[2]: Invalid argument supplied for foreach(), File: /www/wwwroot/roclinux.cn/tmp/view_template_quzhiwa_htm_read.htm, Line: 58
File: /www/wwwroot/roclinux.cn/tmp/route_read.php, Line: 205, include(/www/wwwroot/roclinux.cn/tmp/view_template_quzhiwa_htm_read.htm)
File: /www/wwwroot/roclinux.cn/tmp/index.inc.php, Line: 129, include(/www/wwwroot/roclinux.cn/tmp/route_read.php)
File: /www/wwwroot/roclinux.cn/index.php, Line: 29, include(/www/wwwroot/roclinux.cn/tmp/index.inc.php)