Mono Class Library: MonoTouch.UIKit Namespace

MonoTouch.UIKit.UIDevice Class

Device information.

See Also: UIDevice Members

System.Object
     MonoTouch.Foundation.NSObject
          MonoTouch.UIKit.UIDevice

[MonoTouch.Foundation.Register("UIDevice")]
[MonoTouch.ObjCRuntime.Since(3, 2)]
public class UIDevice : MonoTouch.Foundation.NSObject

Remarks

Overview

The UIDevice class provides a singleton instance representing the current device. From this instance you can obtain information about the device such as unique ID, assigned name, device model, and operating-system name and version.

You also use the UIDevice instance to detect changes in the device’s characteristics, such as physical orientation. You get the current orientation using the UIDevice.Orientation property or receive change notifications by registering for the UIDeviceOrientationDidChangeNotification notification. Before using either of these techniques to get orientation data, you must enable data delivery using the UIDevice.BeginGeneratingDeviceOrientationNotifications method. When you no longer need to track the device orientation, call the UIDevice.EndGeneratingDeviceOrientationNotifications method to disable the delivery of notifications.

Similarly, you can use the UIDevice instance to obtain information and notifications about changes to the battery’s charge state (described by the UIDevice.BatteryState property) and charge level (described by the UIDevice.BatteryLevel property). The UIDevice instance also provides access to the proximity sensor state (described by the UIDevice.ProximityState property). The proximity sensor detects whether the user is holding the device close to their face. Enable battery monitoring or proximity sensing only when you need it.

Requirements

Namespace: MonoTouch.UIKit
Assembly: monotouch (in monotouch.dll)
Assembly Versions: 0.0.0.0