<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIDevice",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIDevice"
  },
  "title" : "UIDevice"
}
-->

# UIDevice

A representation of the current device.

```
@MainActor class UIDevice
```

## Overview

Use a [`UIDevice`](/documentation/UIKit/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`](/documentation/UIKit/UIDevice/orientation) property or receive change notifications by registering for the [`orientationDidChangeNotification`](/documentation/UIKit/UIDevice/orientationDidChangeNotification) notification. Before using either of these techniques to get orientation data, you must enable data delivery using the [`beginGeneratingDeviceOrientationNotifications()`](/documentation/UIKit/UIDevice/beginGeneratingDeviceOrientationNotifications()) method. When you no longer need to track the device orientation, call the [`endGeneratingDeviceOrientationNotifications()`](/documentation/UIKit/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 [`batteryState`](/documentation/UIKit/UIDevice/batteryState-swift.property) property) and charge level (described by the [`batteryLevel`](/documentation/UIKit/UIDevice/batteryLevel) property). The `UIDevice` instance also provides access to the proximity sensor state (described by the [`proximityState`](/documentation/UIKit/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.

You can also use the [`playInputClick()`](/documentation/UIKit/UIDevice/playInputClick()) instance method to play keyboard input clicks in custom input and keyboard accessory views.

## Topics

### Getting the shared device instance

[`current`](/documentation/UIKit/UIDevice/current)

An object that represents the current device.

### Identifying the device and operating system

[`name`](/documentation/UIKit/UIDevice/name)

The name of the device.

[`systemName`](/documentation/UIKit/UIDevice/systemName)

The name of the operating system running on the device.

[`systemVersion`](/documentation/UIKit/UIDevice/systemVersion)

The current version of the operating system.

[`model`](/documentation/UIKit/UIDevice/model)

The model of the device.

[`localizedModel`](/documentation/UIKit/UIDevice/localizedModel)

The model of the device as a localized string.

[`userInterfaceIdiom`](/documentation/UIKit/UIDevice/userInterfaceIdiom)

The style of interface to use on the current device.

[`identifierForVendor`](/documentation/UIKit/UIDevice/identifierForVendor)

An alphanumeric string that uniquely identifies a device to the app’s vendor.

### Determining the available features

[`isMultitaskingSupported`](/documentation/UIKit/UIDevice/isMultitaskingSupported)

A Boolean value that indicates whether the current device supports multitasking.

### Tracking the device orientation

[`orientation`](/documentation/UIKit/UIDevice/orientation)

The physical orientation of the device.

[`UIDeviceOrientation`](/documentation/UIKit/UIDeviceOrientation)

Constants that describe the physical orientation of the device.

[`isGeneratingDeviceOrientationNotifications`](/documentation/UIKit/UIDevice/isGeneratingDeviceOrientationNotifications)

A Boolean value that indicates whether the device generates orientation notifications.

[`beginGeneratingDeviceOrientationNotifications()`](/documentation/UIKit/UIDevice/beginGeneratingDeviceOrientationNotifications())

Begins the generation of notifications of device orientation changes.

[`endGeneratingDeviceOrientationNotifications()`](/documentation/UIKit/UIDevice/endGeneratingDeviceOrientationNotifications())

Ends the generation of notifications of device orientation changes.

### Determining the current orientation

[`isPortrait`](/documentation/UIKit/UIDeviceOrientation/isPortrait)

A Boolean value that indicates whether the device is in a portrait orientation.

[`isLandscape`](/documentation/UIKit/UIDeviceOrientation/isLandscape)

A Boolean value that indicates whether the device is in a landscape orientation.

[`isFlat`](/documentation/UIKit/UIDeviceOrientation/isFlat)

A Boolean value that indicates whether the specified orientation is face up or face down.

[`isValidInterfaceOrientation`](/documentation/UIKit/UIDeviceOrientation/isValidInterfaceOrientation)

A Boolean value that indicates whether the specified orientation is one of the portrait or landscape orientations.

### Getting the device battery state

[`batteryLevel`](/documentation/UIKit/UIDevice/batteryLevel)

The battery charge level for the device.

[`isBatteryMonitoringEnabled`](/documentation/UIKit/UIDevice/isBatteryMonitoringEnabled)

A Boolean value that indicates whether battery monitoring is enabled.

[`batteryState`](/documentation/UIKit/UIDevice/batteryState-swift.property)

The battery state for the device.

[`UIDevice.BatteryState`](/documentation/UIKit/UIDevice/BatteryState-swift.enum)

Constants that describe the battery power state of the device.

### Using the proximity sensor

[`isProximityMonitoringEnabled`](/documentation/UIKit/UIDevice/isProximityMonitoringEnabled)

A Boolean value that indicates whether proximity monitoring is enabled.

[`proximityState`](/documentation/UIKit/UIDevice/proximityState)

A Boolean value that indicates whether the proximity sensor is close to the user.

### Playing input clicks

[`playInputClick()`](/documentation/UIKit/UIDevice/playInputClick())

Plays an input click in an enabled input view.

### Getting the current idiom

[`UIUserInterfaceIdiom`](/documentation/UIKit/UIUserInterfaceIdiom)

Constants that indicate the interface type for the device or an object that has a trait environment, such as a view and view controller.

[`UI_USER_INTERFACE_IDIOM()`](/documentation/UIKit/UI_USER_INTERFACE_IDIOM())

Returns the interface idiom supported by the current device (recommended for apps that run in versions of iOS earlier than 3.2).

### Managing notifications

All [`UIDevice`](/documentation/UIKit/UIDevice)

A representation of the current device. notifications are posted by the singleton device instance returned by [`current`](/documentation/UIKit/UIDevice/current)

An object that represents the current device..

[`batteryLevelDidChangeNotification`](/documentation/UIKit/UIDevice/batteryLevelDidChangeNotification)

A notification that posts when the battery level changes.

[`batteryStateDidChangeNotification`](/documentation/UIKit/UIDevice/batteryStateDidChangeNotification)

A notification that posts when battery state changes.

[`orientationDidChangeNotification`](/documentation/UIKit/UIDevice/orientationDidChangeNotification)

A notification that posts when the orientation of the device changes.

[`proximityStateDidChangeNotification`](/documentation/UIKit/UIDevice/proximityStateDidChangeNotification)

A notification that posts when the state of the proximity sensor changes.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)