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

Syntax

[Foundation.Export("displayLinkWithTarget:selector:")]
[ObjCRuntime.Availability(Introduced=ObjCRuntime.Platform.iOS_4_0)]
public virtual CoreAnimation.CADisplayLink CreateDisplayLink (Foundation.NSObject target, ObjCRuntime.Selector sel)

Parameters

target
Target object
sel
Selector method to invoke on the target object.

Returns

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

Remarks

You can configure the display link by setting the CoreAnimation.CADisplayLink.FrameInterval and CoreAnimation.CADisplayLink.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.

C# Example

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
}
	    

Requirements

Namespace: UIKit
Assembly: Xamarin.iOS (in Xamarin.iOS.dll)
Assembly Versions: 0.0.0.0