Instance Property

preferredFramesPerSecond

The preferred frame rate for the display link callback.

Declaration

var preferredFramesPerSecond: Int { get set }

Discussion

When you specify a preferred frame rate for a display link, it notifies the target at a rate as close as possible based on the capabilities on the hardware and other tasks your game or app may be executing. The actual frame rate chosen is usually a factor of the maximum refresh rate of the screen to provide a consistent frame rate. For example, if the maximum refresh rate of the screen is 60 frames per second, that is also the highest frame rate the display link sets as the actual frame rate. However, if you ask for a lower frame rate, the display link might choose 30, 20, or 15 frames per second, or another rate, as the actual frame rate. Choose a frame rate that your app can consistently maintain.

The default value is 0. When this value is 0, the preferred frame rate is equal to the maximum refresh rate of the display, as indicated by the maximumFramesPerSecond property. See Setting Refresh Rates on ProMotion and Traditional Displays for more information.

See Also

Configuring the Display Link

var duration: CFTimeInterval

The time interval between screen refresh updates.

var frameInterval: Int

The number of frames that must pass before the display link notifies the target again.

Deprecated
var isPaused: Bool

A Boolean value that states whether the display link’s notifications to the target are suspended.

var timestamp: CFTimeInterval

The time value associated with the last frame that was displayed.

var targetTimestamp: CFTimeInterval

The time value associated with the next frame that was displayed.