Instance Method

add(to:forMode:)

Registers the display link with a run loop.

Declaration

func add(to runloop: RunLoop, forMode mode: RunLoop.Mode)

Parameters

runloop

The run loop to associate with the display link.

mode

The mode in which to add the display link to the run loop. You may specify a custom mode or use one of the modes listed in RunLoop.

Discussion

You can associate a display link with multiple input modes. While the run loop is executing in a mode you have specified, the display link notifies the target when new frames are required.

The run loop retains the display link. To remove the display link from all run loops, send an invalidate() message to the display link.

See Also

Scheduling the Display Link to Send Notifications

func remove(from: RunLoop, forMode: RunLoop.Mode)

Removes the display link from the run loop for the given mode.

func invalidate()

Removes the display link from all run loop modes.