SKSensorType
Objective-C
enum SKSensorType : NSUInteger {}
Swift
enum SKSensorType : UInt, @unchecked Sendable
These constants indicate the type of the sensor.
-
Accelerometer is a sensor that measures the device acceleration changes in three‑dimensional space. You can use this data to detect both the current orientation of the device (relative to the ground) and any instantaneous changes to that orientation.
Declaration
Objective-C
Accelerometer = 0Swift
case Accelerometer = 0 -
Gyroscope is a sensor that measures the device’s rate of rotation around each of the three spatial axes.
Declaration
Objective-C
GyroscopeSwift
case Gyroscope = 1 -
Magnetometer (also known as Compass or Magnetic Field Sensor) is a sensor that measures the strength of the magnetic field surrounding the device.
Declaration
Objective-C
MagnetometerSwift
case Magnetometer = 2 -
Device Motion sensor uses sensor fusion techniques to provide more advanced and accurate motion measurements. It measures the Attitude, Rotation Rate, Calibrated Magnetic Field, as well as a separation of User Acceleration and Gravity from the device’s acceleration.
Declaration
Objective-C
DeviceMotionSwift
case DeviceMotion = 3 -
Motion Activity sensor uses an embedded motion co‑processor that senses the user’s activity classified as Stationary, Walking, Running, Automotive or Cycling.
Declaration
Objective-C
MotionActivitySwift
case MotionActivity = 4 -
Pedometer sensor uses an embedded motion co‑processor that captures pedestrian‑related data such as step counts, distance traveled and number of floors ascended or descended.
Declaration
Objective-C
PedometerSwift
case Pedometer = 5 -
Altimeter sensor uses an embedded barometer sensor to capture changes to the relative altitude (not the actual). It also provides the recorded atmospheric pressure in kPa.
Declaration
Objective-C
AltimeterSwift
case Altimeter = 6 -
Battery Status sensor listens to changes in the battery charge state (Charging, Full, Unplugged), battery charge level (with 1% precision), and Low Power Model (disabled or enabled).
Declaration
Objective-C
BatteryStatusSwift
case BatteryStatus = 7 -
Location sensor determines the current location of the device using a combination of Cellular, Wi‑Fi, Bluetooth and GPS sensors. It provides 2D geographical coordinate information (latitude, longitude), as well as the altitude of the device.
Declaration
Objective-C
LocationSwift
case Location = 8 -
Heading is a sensor that reports the device’s orientation relative to magnetic and true north.
Declaration
Objective-C
HeadingSwift
case Heading = 9 -
iBeacon™ Proximity sensor uses Apple’s iBeacon™ technology to estimate the proximity of the current device with other iBeacons in range.
Declaration
Objective-C
iBeaconProximitySwift
case iBeaconProximity = 10 -
Eddystone™ Proximity sensor estimates the proximity of the current device with other Eddystone™ beacons in range.
Declaration
Objective-C
EddystoneProximitySwift
case EddystoneProximity = 11 -
Microphone sensor(s) can be used to record audio from the environment (up to 4 hours) by converting sound into electrical signal.
Declaration
Objective-C
MicrophoneSwift
case Microphone = 12 -
The Screen Brightness sensor listens for changes in the device screen brightness level and reports it with 1% precision. This change can happen manually by the user or automatically by the OS when Auto-Brightness feature is enabled (Settings > Accessibility > Display & Text Size).
Declaration
Objective-C
ScreenBrightnessSwift
case ScreenBrightness = 13 -
The Network Connection sensor reports changes in the device’s network connectivity (e.g., WiFi vs. Cellular, WiFi SSID or Cellular carrier, IP address, etc.), quality (e.g., signal strength, Internet reachability, etc.) and network data consumption (in bytes).
Declaration
Objective-C
NetworkConnectionSwift
case NetworkConnection = 14
View on GitHub