Platforms to show: All Mac Windows Linux Cross-Platform

UIDeviceMBS class

Type Topic Plugin Version macOS Windows Linux iOS Targets
class iOS MBS iOS Plugin 24.3 ❌ No ❌ No ❌ No ✅ Yes iOS only
A representation of the current device.
Example
Var currentDevice As UIDeviceMBS = UIDeviceMBS.currentDevice

MessageBox currentDevice.SystemName + EndOfLine+ currentDevice.SystemVersion

Use a UIDevice object to get information about the device such as 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 orientation property or receive change notifications by using the OrientationDidChange event. Before using either of these techniques to get orientation data, you must enable data delivery using the beginGeneratingDeviceOrientationNotifications method. When you no longer need to track the device orientation, call the 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 batteryState property) and charge level (described by the batteryLevel property). The UIDevice instance also provides access to the proximity sensor state (described by the 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.

You can also use the playInputClick instance method to play keyboard input clicks in custom input and keyboard accessory views.

Battery States

Constant Value Description
BatteryStateCharging 2 The device is plugged into power and the battery is less than 100% charged.
BatteryStateFull 3 The device is plugged into power and the battery is 100% charged.
BatteryStateUnknown 0 The battery state for the device can’t be determined.
BatteryStateUnplugged 1 The device isn’t plugged into power; the battery is discharging.

Device Orientations

Constant Value Description
DeviceOrientationFaceDown 6 The device is held parallel to the ground with the screen facing downwards.
DeviceOrientationFaceUp 5 The device is held parallel to the ground with the screen facing upwards.
DeviceOrientationLandscapeLeft 3 The device is in landscape mode, with the device held upright and the front-facing camera on the left side.
DeviceOrientationLandscapeRight 4 The device is in landscape mode, with the device held upright and the front-facing camera on the right side.
DeviceOrientationPortrait 1 The device is in portrait mode, with the device held upright and the front-facing camera at the top.
DeviceOrientationPortraitUpsideDown 2 The device is in portrait mode but upside down, with the device held upright and the front-facing camera at the bottom.
DeviceOrientationUnknown 0 The orientation of the device can’t be determined.

User Interface Idioms

Constant Value Description
UserInterfaceIdiomCarPlay 3 An interface designed for an in-car experience.
UserInterfaceIdiomMac 5 An interface designed for the Mac.
UserInterfaceIdiomPad 1 An interface designed for iPad.
UserInterfaceIdiomPhone 0 An interface designed for iPhone and iPod touch.
UserInterfaceIdiomTV 2 An interface designed for tvOS and Apple TV.
UserInterfaceIdiomUnspecified -1 An unspecified idiom.
UserInterfaceIdiomVision 6 An interface designed for visionOS and Apple Vision Pro.

This class has no sub classes.

Blog Entries

Release notes

  • Version 24.3

The items on this page are in the following plugins: MBS iOS Plugin.


UDPSocketMBS   -   UIDocumentPickerMBS


The biggest plugin in space...