UIScreen.CreateDisplayLink Method

Definition

Overloads

CreateDisplayLink(Action)

Registers a method to be invoked whenever the display screen needs to be updated.

CreateDisplayLink(NSObject, Selector)

Old-style registeration of a method to be invoked whenever the display screen needs to be updated.

CreateDisplayLink(Action)

Registers a method to be invoked whenever the display screen needs to be updated.

public CoreAnimation.CADisplayLink CreateDisplayLink (Action action);
member this.CreateDisplayLink : Action -> CoreAnimation.CADisplayLink

Parameters

action
Action

Delegate method to invoke when the screen needs to be updated.

Returns

The active display link that can be configured, read from and scheduled to deliver events.

Applies to

CreateDisplayLink(NSObject, Selector)

Old-style registeration of a method to be invoked whenever the display screen needs to be updated.

[Foundation.Export("displayLinkWithTarget:selector:")]
public virtual CoreAnimation.CADisplayLink CreateDisplayLink (Foundation.NSObject target, ObjCRuntime.Selector sel);
abstract member CreateDisplayLink : Foundation.NSObject * ObjCRuntime.Selector -> CoreAnimation.CADisplayLink
override this.CreateDisplayLink : Foundation.NSObject * ObjCRuntime.Selector -> CoreAnimation.CADisplayLink

Parameters

target
NSObject

Target object

sel
Selector

Selector method to invoke on the target object.

Returns

Attributes

Remarks

You can configure the display link by setting the FrameInterval and Paused properties. Once you have done this, you need to add the display link to a run loop, which is the run loop that will be used to invoke the action method.

void Setup ()
{
    var link = UIScreen.CreateDisplayLink (this, new Selector ("callback")]

    // The default is 1, we want updates only once every 2 frames instead:
    link.FrameInterval = 2;
    link.AddToRunLoop (NSRunLoop.CurrentRunLoop, NSRunLoop.NSDefaultRunLoopMode);
}

[Export ("callback")]
void WillRefresh ()
{
    This method is invoked
}

Applies to