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 |
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.
- 4 events
- event BatteryLevelDidChange
- event BatteryStateDidChange
- event OrientationDidChange
- event ProximityStateDidChange
- 16 properties
- property BatteryLevel as Double
- property BatteryMonitoringEnabled as Boolean
- property BatteryState as Integer
- property Handle as Integer
- property identifierForVendor as String
- property isGeneratingDeviceOrientationNotifications as Boolean
- property isMultitaskingSupported as Boolean
- property LocalizedModel as String
- property Model as String
- property Name as String
- property Orientation as Integer
- property ProximityMonitoringEnabled as Boolean
- property ProximityState as Boolean
- property SystemName as String
- property SystemVersion as String
- property UserInterfaceIdiom as Integer
- shared property InterfaceOrientation as Integer
- 4 methods
- method beginGeneratingDeviceOrientationNotifications
- method Constructor
- method Destructor
- method endGeneratingDeviceOrientationNotifications
- shared method currentDevice as UIDeviceMBS
- 18 constants
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
- News from the MBS Xojo Plugins Version 24.3
- MonkeyBread Software Releases the MBS Xojo Plugins in version 24.3
- MBS Xojo Plugins, version 24.3pr6
- MBS Xojo Plugins, version 24.3pr4
Release notes
- Version 24.3
- Added InterfaceOrientation to UIDeviceMBS to query orientation of current window.
- Added UIDeviceMBS class.
The items on this page are in the following plugins: MBS iOS Plugin.
UDPSocketMBS - UIDocumentPickerMBS
