WatchKit.WKInterfaceController Class
Base class for controller objects in Watch Extension projects.

See Also: WKInterfaceController Members

Syntax

[Foundation.Register("WKInterfaceController", true)]
[ObjCRuntime.Availability(Introduced=ObjCRuntime.Platform.iOS_8_2)]
public abstract class WKInterfaceController : Foundation.NSObject

Remarks

Watch Kit Extensions extend WKInterfaceController to access the Watch App lifecycle.

When associated with a Watch App storyboard (the most common way in which a WatchKit.WKInterfaceController is instantiated), the WatchKit.WKInterfaceController.ctor(IntPtr) constructor is used. Application developers should use this and the WKInterfaceController.Awake method to do the bulk of their initialization work.

Shortly before the Watch App's user interface appears to the user, the system calls the WKInterfaceController.WillActivate method. This method is also called if the app has been deactivated but not terminated. Developers should use this method for last-minute initialization and to, for instance, begin animations or other interface-related processes.

After the Watch App has been dismissed by the user, the system calls the WKInterfaceController.DidDeactivate method. After this method exits, the Watch Extension may perform no further processing. Pending asynchronous methods will not run. Watch Extension's may not use background processing modes. App devs who need to process data while the Watch Extension is deactivated must use the parent app to do so, communicating, as necessary, by using the WKInterfaceController.OpenParentApplication and UIKit.UIApplicationDelegate.HandleWatchKitExtensionRequest methods.

Requirements

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