sourceDevice
NewiOSopen var sourceDevice: SRSourceDevice? { get }What's New / Health, Sensors & Motion
SensorKit gives apps access to sensor data and on-device metrics from iPhone and Apple Watch, including motion, ambient light and pressure, device usage, and physiological signals, subject to user authorization.
The 27 SDK adds 58 APIs and deprecates 2, removing none. New per-source sensor structs include SRAccelerometerSensor, SRAmbientLightSensor, SRAmbientPressureSensor, SRDeviceUsageSensor, SRElectrocardiogramSensor, SRFaceMetricsSensor, and SRAcousticSettingsSensor, plus an SRDataSensor protocol, an SRFetchResponse struct, and the enums SettingEnablement, ListeningMode, and AdaptiveAudioStrength. SRSensor gains headphoneMotion and headphoneSettings. The deprecations are SRSensorReaderDelegate and an NSString-typed API.
sourceDeviceopen var sourceDevice: SRSourceDevice? { get }SRAccelerometerSensorpublic struct SRAccelerometerSensor : SRDataSensorpublic struct SRAccelerometerSensor : SRDataSensor {
public typealias Sample = [CMRecordedAccelerometerData]
public init()
/// Returns a Boolean value indicating whether two values are equal.
///
/// Equality is the inverse of inequality. For any values `a` and `b`,
/// `a == b` implies that `a != b` is `false`.
///
/// - Parameters:
/// - lhs: A value to compare.
/// - rhs: Another value to compare.
public static func == (lhs: SRAccelerometerSensor, rhs: SRAccelerometerSensor) -> Bool
/// Hashes the essential components of this value by feeding them into the
/// given hasher.
///
/// Implement this method to conform to the `Hashable` protocol. The
/// components used for hashing must be the same as the components compared
/// in your type's `==` operator implementation. Call `hasher.combine(_:)`
/// with each of these components.
///
/// - Important: In your implementation of `hash(into:)`,
/// don't call `finalize()` on the `hasher` instance provided,
/// or replace it with a different instance.
/// Doing so may become a compile-time error in the future.
///
/// - Parameter hasher: The hasher to use when combining the components
/// of this instance.
public func hash(into hasher: inout Hasher)
/// The hash value.
///
/// Hash values are not guaranteed to be equal across different executions of
/// your program. Do not save hash values to use during a future execution.
///
/// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
/// conform to `Hashable`, implement the `hash(into:)` requirement instead.
/// The compiler provides an implementation for `hashValue` for you.
public var hashValue: Int { get }
}SRAcousticSettingsSensorpublic struct SRAcousticSettingsSensor : SRDataSensorpublic struct SRAcousticSettingsSensor : SRDataSensor {
public typealias Sample = SRAcousticSettings
public init()
/// Returns a Boolean value indicating whether two values are equal.
///
/// Equality is the inverse of inequality. For any values `a` and `b`,
/// `a == b` implies that `a != b` is `false`.
///
/// - Parameters:
/// - lhs: A value to compare.
/// - rhs: Another value to compare.
public static func == (lhs: SRAcousticSettingsSensor, rhs: SRAcousticSettingsSensor) -> Bool
/// Hashes the essential components of this value by feeding them into the
/// given hasher.
///
/// Implement this method to conform to the `Hashable` protocol. The
/// components used for hashing must be the same as the components compared
/// in your type's `==` operator implementation. Call `hasher.combine(_:)`
/// with each of these components.
///
/// - Important: In your implementation of `hash(into:)`,
/// don't call `finalize()` on the `hasher` instance provided,
/// or replace it with a different instance.
/// Doing so may become a compile-time error in the future.
///
/// - Parameter hasher: The hasher to use when combining the components
/// of this instance.
public func hash(into hasher: inout Hasher)
/// The hash value.
///
/// Hash values are not guaranteed to be equal across different executions of
/// your program. Do not save hash values to use during a future execution.
///
/// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
/// conform to `Hashable`, implement the `hash(into:)` requirement instead.
/// The compiler provides an implementation for `hashValue` for you.
public var hashValue: Int { get }
}SRAmbientLightSensorpublic struct SRAmbientLightSensor : SRDataSensorpublic struct SRAmbientLightSensor : SRDataSensor {
public typealias Sample = SRAmbientLightSample
public init()
/// Returns a Boolean value indicating whether two values are equal.
///
/// Equality is the inverse of inequality. For any values `a` and `b`,
/// `a == b` implies that `a != b` is `false`.
///
/// - Parameters:
/// - lhs: A value to compare.
/// - rhs: Another value to compare.
public static func == (lhs: SRAmbientLightSensor, rhs: SRAmbientLightSensor) -> Bool
/// Hashes the essential components of this value by feeding them into the
/// given hasher.
///
/// Implement this method to conform to the `Hashable` protocol. The
/// components used for hashing must be the same as the components compared
/// in your type's `==` operator implementation. Call `hasher.combine(_:)`
/// with each of these components.
///
/// - Important: In your implementation of `hash(into:)`,
/// don't call `finalize()` on the `hasher` instance provided,
/// or replace it with a different instance.
/// Doing so may become a compile-time error in the future.
///
/// - Parameter hasher: The hasher to use when combining the components
/// of this instance.
public func hash(into hasher: inout Hasher)
/// The hash value.
///
/// Hash values are not guaranteed to be equal across different executions of
/// your program. Do not save hash values to use during a future execution.
///
/// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
/// conform to `Hashable`, implement the `hash(into:)` requirement instead.
/// The compiler provides an implementation for `hashValue` for you.
public var hashValue: Int { get }
}SRAmbientPressureSensorpublic struct SRAmbientPressureSensor : SRDataSensorpublic struct SRAmbientPressureSensor : SRDataSensor {
public typealias Sample = [CMRecordedPressureData]
public init()
/// Returns a Boolean value indicating whether two values are equal.
///
/// Equality is the inverse of inequality. For any values `a` and `b`,
/// `a == b` implies that `a != b` is `false`.
///
/// - Parameters:
/// - lhs: A value to compare.
/// - rhs: Another value to compare.
public static func == (lhs: SRAmbientPressureSensor, rhs: SRAmbientPressureSensor) -> Bool
/// Hashes the essential components of this value by feeding them into the
/// given hasher.
///
/// Implement this method to conform to the `Hashable` protocol. The
/// components used for hashing must be the same as the components compared
/// in your type's `==` operator implementation. Call `hasher.combine(_:)`
/// with each of these components.
///
/// - Important: In your implementation of `hash(into:)`,
/// don't call `finalize()` on the `hasher` instance provided,
/// or replace it with a different instance.
/// Doing so may become a compile-time error in the future.
///
/// - Parameter hasher: The hasher to use when combining the components
/// of this instance.
public func hash(into hasher: inout Hasher)
/// The hash value.
///
/// Hash values are not guaranteed to be equal across different executions of
/// your program. Do not save hash values to use during a future execution.
///
/// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
/// conform to `Hashable`, implement the `hash(into:)` requirement instead.
/// The compiler provides an implementation for `hashValue` for you.
public var hashValue: Int { get }
}SRAuthorizationStatusextension SRAuthorizationStatusextension SRAuthorizationStatus {
public static func requestAuthorization(for sensors: [any SRDataSensor]) async throws
}SRDataSensorpublic protocol SRDataSensor : Hashable, Sendablepublic protocol SRDataSensor : Hashable, Sendable {
associatedtype Sample
}SRDataSensorextension SRDataSensor where Self == SRAmbientLightSensorextension SRDataSensor where Self == SRAmbientLightSensor {
public static var ambientLight: SRAmbientLightSensor { get }
}SRDataSensorextension SRDataSensor where Self == SRVisitsSensorextension SRDataSensor where Self == SRVisitsSensor {
public static var visits: SRVisitsSensor { get }
}SRDataSensorextension SRDataSensor where Self == SRDeviceUsageSensorextension SRDataSensor where Self == SRDeviceUsageSensor {
public static var deviceUsage: SRDeviceUsageSensor { get }
}SRDataSensorextension SRDataSensor where Self == SRMessagesUsageSensorextension SRDataSensor where Self == SRMessagesUsageSensor {
public static var messagesUsage: SRMessagesUsageSensor { get }
}SRDataSensorextension SRDataSensor where Self == SRPhoneUsageSensorextension SRDataSensor where Self == SRPhoneUsageSensor {
public static var phoneUsage: SRPhoneUsageSensor { get }
}SRDataSensorextension SRDataSensor where Self == SROnWristStateSensorextension SRDataSensor where Self == SROnWristStateSensor {
public static var onWristState: SROnWristStateSensor { get }
}SRDataSensorextension SRDataSensor where Self == SRKeyboardMetricsSensorextension SRDataSensor where Self == SRKeyboardMetricsSensor {
public static var keyboardMetrics: SRKeyboardMetricsSensor { get }
}SRDataSensorextension SRDataSensor where Self == SRSiriSpeechMetricsSensorextension SRDataSensor where Self == SRSiriSpeechMetricsSensor {
public static var siriSpeechMetrics: SRSiriSpeechMetricsSensor { get }
}SRDataSensorextension SRDataSensor where Self == SRTelephonySpeechMetricsSensorextension SRDataSensor where Self == SRTelephonySpeechMetricsSensor {
public static var telephonySpeechMetrics: SRTelephonySpeechMetricsSensor { get }
}SRDataSensorextension SRDataSensor where Self == SRMediaEventsSensorextension SRDataSensor where Self == SRMediaEventsSensor {
public static var mediaEvents: SRMediaEventsSensor { get }
}SRDataSensorextension SRDataSensor where Self == SRWristTemperatureSensorextension SRDataSensor where Self == SRWristTemperatureSensor {
public static var wristTemperature: SRWristTemperatureSensor { get }
}SRDataSensorextension SRDataSensor where Self == SRFaceMetricsSensorextension SRDataSensor where Self == SRFaceMetricsSensor {
public static var faceMetrics: SRFaceMetricsSensor { get }
}SRDataSensorextension SRDataSensor where Self == SRAcousticSettingsSensorextension SRDataSensor where Self == SRAcousticSettingsSensor {
public static var acousticSettings: SRAcousticSettingsSensor { get }
}SRDataSensorextension SRDataSensor where Self == SRSleepSessionsSensorextension SRDataSensor where Self == SRSleepSessionsSensor {
public static var sleepSessions: SRSleepSessionsSensor { get }
}SRDataSensorextension SRDataSensor where Self == SRPedometerDataSensorextension SRDataSensor where Self == SRPedometerDataSensor {
public static var pedometerData: SRPedometerDataSensor { get }
}SRDataSensorextension SRDataSensor where Self == SRHeartRateSensorextension SRDataSensor where Self == SRHeartRateSensor {
public static var heartRate: SRHeartRateSensor { get }
}SRDataSensorextension SRDataSensor where Self == SROdometerSensorextension SRDataSensor where Self == SROdometerSensor {
public static var odometer: SROdometerSensor { get }
}SRDataSensorextension SRDataSensor where Self == SRRotationRateSensorextension SRDataSensor where Self == SRRotationRateSensor {
public static var rotationRate: SRRotationRateSensor { get }
}SRDataSensorextension SRDataSensor where Self == SRAccelerometerSensorextension SRDataSensor where Self == SRAccelerometerSensor {
public static var accelerometer: SRAccelerometerSensor { get }
}SRDataSensorextension SRDataSensor where Self == SRAmbientPressureSensorextension SRDataSensor where Self == SRAmbientPressureSensor {
public static var ambientPressure: SRAmbientPressureSensor { get }
}SRDataSensorextension SRDataSensor where Self == SRElectrocardiogramSensorextension SRDataSensor where Self == SRElectrocardiogramSensor {
public static var electrocardiogram: SRElectrocardiogramSensor { get }
}SRDataSensorextension SRDataSensor where Self == SRPhotoplethysmogramSensorextension SRDataSensor where Self == SRPhotoplethysmogramSensor {
public static var photoplethysmogram: SRPhotoplethysmogramSensor { get }
}SRDataSensorextension SRDataSensor where Self == SRHeadphoneMotionSensorextension SRDataSensor where Self == SRHeadphoneMotionSensor {
public static var headphoneMotion: SRHeadphoneMotionSensor { get }
}SRDataSensorextension SRDataSensor where Self == SRHeadphoneSettingsSensorextension SRDataSensor where Self == SRHeadphoneSettingsSensor {
public static var headphoneSettings: SRHeadphoneSettingsSensor { get }
}SRDeviceUsageSensorpublic struct SRDeviceUsageSensor : SRDataSensorpublic struct SRDeviceUsageSensor : SRDataSensor {
public typealias Sample = SRDeviceUsageReport
public init()
/// Returns a Boolean value indicating whether two values are equal.
///
/// Equality is the inverse of inequality. For any values `a` and `b`,
/// `a == b` implies that `a != b` is `false`.
///
/// - Parameters:
/// - lhs: A value to compare.
/// - rhs: Another value to compare.
public static func == (lhs: SRDeviceUsageSensor, rhs: SRDeviceUsageSensor) -> Bool
/// Hashes the essential components of this value by feeding them into the
/// given hasher.
///
/// Implement this method to conform to the `Hashable` protocol. The
/// components used for hashing must be the same as the components compared
/// in your type's `==` operator implementation. Call `hasher.combine(_:)`
/// with each of these components.
///
/// - Important: In your implementation of `hash(into:)`,
/// don't call `finalize()` on the `hasher` instance provided,
/// or replace it with a different instance.
/// Doing so may become a compile-time error in the future.
///
/// - Parameter hasher: The hasher to use when combining the components
/// of this instance.
public func hash(into hasher: inout Hasher)
/// The hash value.
///
/// Hash values are not guaranteed to be equal across different executions of
/// your program. Do not save hash values to use during a future execution.
///
/// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
/// conform to `Hashable`, implement the `hash(into:)` requirement instead.
/// The compiler provides an implementation for `hashValue` for you.
public var hashValue: Int { get }
}SRElectrocardiogramSensorpublic struct SRElectrocardiogramSensor : SRDataSensorpublic struct SRElectrocardiogramSensor : SRDataSensor {
public typealias Sample = [SRElectrocardiogramSample]
public init()
/// Returns a Boolean value indicating whether two values are equal.
///
/// Equality is the inverse of inequality. For any values `a` and `b`,
/// `a == b` implies that `a != b` is `false`.
///
/// - Parameters:
/// - lhs: A value to compare.
/// - rhs: Another value to compare.
public static func == (lhs: SRElectrocardiogramSensor, rhs: SRElectrocardiogramSensor) -> Bool
/// Hashes the essential components of this value by feeding them into the
/// given hasher.
///
/// Implement this method to conform to the `Hashable` protocol. The
/// components used for hashing must be the same as the components compared
/// in your type's `==` operator implementation. Call `hasher.combine(_:)`
/// with each of these components.
///
/// - Important: In your implementation of `hash(into:)`,
/// don't call `finalize()` on the `hasher` instance provided,
/// or replace it with a different instance.
/// Doing so may become a compile-time error in the future.
///
/// - Parameter hasher: The hasher to use when combining the components
/// of this instance.
public func hash(into hasher: inout Hasher)
/// The hash value.
///
/// Hash values are not guaranteed to be equal across different executions of
/// your program. Do not save hash values to use during a future execution.
///
/// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
/// conform to `Hashable`, implement the `hash(into:)` requirement instead.
/// The compiler provides an implementation for `hashValue` for you.
public var hashValue: Int { get }
}SRFaceMetricsSensorpublic struct SRFaceMetricsSensor : SRDataSensorpublic struct SRFaceMetricsSensor : SRDataSensor {
public typealias Sample = SRFaceMetrics
public init()
/// Returns a Boolean value indicating whether two values are equal.
///
/// Equality is the inverse of inequality. For any values `a` and `b`,
/// `a == b` implies that `a != b` is `false`.
///
/// - Parameters:
/// - lhs: A value to compare.
/// - rhs: Another value to compare.
public static func == (lhs: SRFaceMetricsSensor, rhs: SRFaceMetricsSensor) -> Bool
/// Hashes the essential components of this value by feeding them into the
/// given hasher.
///
/// Implement this method to conform to the `Hashable` protocol. The
/// components used for hashing must be the same as the components compared
/// in your type's `==` operator implementation. Call `hasher.combine(_:)`
/// with each of these components.
///
/// - Important: In your implementation of `hash(into:)`,
/// don't call `finalize()` on the `hasher` instance provided,
/// or replace it with a different instance.
/// Doing so may become a compile-time error in the future.
///
/// - Parameter hasher: The hasher to use when combining the components
/// of this instance.
public func hash(into hasher: inout Hasher)
/// The hash value.
///
/// Hash values are not guaranteed to be equal across different executions of
/// your program. Do not save hash values to use during a future execution.
///
/// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
/// conform to `Hashable`, implement the `hash(into:)` requirement instead.
/// The compiler provides an implementation for `hashValue` for you.
public var hashValue: Int { get }
}SRFetchResponsepublic struct SRFetchResponse<Sample> : Sendablepublic struct SRFetchResponse<Sample> : Sendable {
/**
* Retrieves the sensor-specific data sample contained in this response.
*/
public var sample: Result<Sample, any Error> { get }
/**
* Retrieves the timestamp when the sensor sample was written to the data store.
*/
public var timestamp: SRAbsoluteTime { get }
/**
* The source of the sample data.
*
* Represents the peripheral supplying data. Useful for distinguishing
* multiple source peripherals using a common device. Is nullable
* when no source information is available when providing sample data.
*/
public var sourceDevice: SRSourceDevice? { get }
}SRHeadphoneMotionSensorpublic struct SRHeadphoneMotionSensor : SRDataSensorpublic struct SRHeadphoneMotionSensor : SRDataSensor {
public typealias Sample = [CMRecordedDeviceMotion]
public init()
/// Returns a Boolean value indicating whether two values are equal.
///
/// Equality is the inverse of inequality. For any values `a` and `b`,
/// `a == b` implies that `a != b` is `false`.
///
/// - Parameters:
/// - lhs: A value to compare.
/// - rhs: Another value to compare.
public static func == (lhs: SRHeadphoneMotionSensor, rhs: SRHeadphoneMotionSensor) -> Bool
/// Hashes the essential components of this value by feeding them into the
/// given hasher.
///
/// Implement this method to conform to the `Hashable` protocol. The
/// components used for hashing must be the same as the components compared
/// in your type's `==` operator implementation. Call `hasher.combine(_:)`
/// with each of these components.
///
/// - Important: In your implementation of `hash(into:)`,
/// don't call `finalize()` on the `hasher` instance provided,
/// or replace it with a different instance.
/// Doing so may become a compile-time error in the future.
///
/// - Parameter hasher: The hasher to use when combining the components
/// of this instance.
public func hash(into hasher: inout Hasher)
/// The hash value.
///
/// Hash values are not guaranteed to be equal across different executions of
/// your program. Do not save hash values to use during a future execution.
///
/// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
/// conform to `Hashable`, implement the `hash(into:)` requirement instead.
/// The compiler provides an implementation for `hashValue` for you.
public var hashValue: Int { get }
}SRHeadphoneSettingsSensorpublic struct SRHeadphoneSettingsSensor : SRDataSensorpublic struct SRHeadphoneSettingsSensor : SRDataSensor {
public typealias Sample = SRHeadphoneSettings
public init()
/// Returns a Boolean value indicating whether two values are equal.
///
/// Equality is the inverse of inequality. For any values `a` and `b`,
/// `a == b` implies that `a != b` is `false`.
///
/// - Parameters:
/// - lhs: A value to compare.
/// - rhs: Another value to compare.
public static func == (lhs: SRHeadphoneSettingsSensor, rhs: SRHeadphoneSettingsSensor) -> Bool
/// Hashes the essential components of this value by feeding them into the
/// given hasher.
///
/// Implement this method to conform to the `Hashable` protocol. The
/// components used for hashing must be the same as the components compared
/// in your type's `==` operator implementation. Call `hasher.combine(_:)`
/// with each of these components.
///
/// - Important: In your implementation of `hash(into:)`,
/// don't call `finalize()` on the `hasher` instance provided,
/// or replace it with a different instance.
/// Doing so may become a compile-time error in the future.
///
/// - Parameter hasher: The hasher to use when combining the components
/// of this instance.
public func hash(into hasher: inout Hasher)
/// The hash value.
///
/// Hash values are not guaranteed to be equal across different executions of
/// your program. Do not save hash values to use during a future execution.
///
/// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
/// conform to `Hashable`, implement the `hash(into:)` requirement instead.
/// The compiler provides an implementation for `hashValue` for you.
public var hashValue: Int { get }
}SRHeartRateSensorpublic struct SRHeartRateSensor : SRDataSensorpublic struct SRHeartRateSensor : SRDataSensor {
public typealias Sample = CMHighFrequencyHeartRateData
public init()
/// Returns a Boolean value indicating whether two values are equal.
///
/// Equality is the inverse of inequality. For any values `a` and `b`,
/// `a == b` implies that `a != b` is `false`.
///
/// - Parameters:
/// - lhs: A value to compare.
/// - rhs: Another value to compare.
public static func == (lhs: SRHeartRateSensor, rhs: SRHeartRateSensor) -> Bool
/// Hashes the essential components of this value by feeding them into the
/// given hasher.
///
/// Implement this method to conform to the `Hashable` protocol. The
/// components used for hashing must be the same as the components compared
/// in your type's `==` operator implementation. Call `hasher.combine(_:)`
/// with each of these components.
///
/// - Important: In your implementation of `hash(into:)`,
/// don't call `finalize()` on the `hasher` instance provided,
/// or replace it with a different instance.
/// Doing so may become a compile-time error in the future.
///
/// - Parameter hasher: The hasher to use when combining the components
/// of this instance.
public func hash(into hasher: inout Hasher)
/// The hash value.
///
/// Hash values are not guaranteed to be equal across different executions of
/// your program. Do not save hash values to use during a future execution.
///
/// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
/// conform to `Hashable`, implement the `hash(into:)` requirement instead.
/// The compiler provides an implementation for `hashValue` for you.
public var hashValue: Int { get }
}SRKeyboardMetricsSensorpublic struct SRKeyboardMetricsSensor : SRDataSensorpublic struct SRKeyboardMetricsSensor : SRDataSensor {
public typealias Sample = SRKeyboardMetrics
public init()
/// Returns a Boolean value indicating whether two values are equal.
///
/// Equality is the inverse of inequality. For any values `a` and `b`,
/// `a == b` implies that `a != b` is `false`.
///
/// - Parameters:
/// - lhs: A value to compare.
/// - rhs: Another value to compare.
public static func == (lhs: SRKeyboardMetricsSensor, rhs: SRKeyboardMetricsSensor) -> Bool
/// Hashes the essential components of this value by feeding them into the
/// given hasher.
///
/// Implement this method to conform to the `Hashable` protocol. The
/// components used for hashing must be the same as the components compared
/// in your type's `==` operator implementation. Call `hasher.combine(_:)`
/// with each of these components.
///
/// - Important: In your implementation of `hash(into:)`,
/// don't call `finalize()` on the `hasher` instance provided,
/// or replace it with a different instance.
/// Doing so may become a compile-time error in the future.
///
/// - Parameter hasher: The hasher to use when combining the components
/// of this instance.
public func hash(into hasher: inout Hasher)
/// The hash value.
///
/// Hash values are not guaranteed to be equal across different executions of
/// your program. Do not save hash values to use during a future execution.
///
/// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
/// conform to `Hashable`, implement the `hash(into:)` requirement instead.
/// The compiler provides an implementation for `hashValue` for you.
public var hashValue: Int { get }
}SRMediaEventsSensorpublic struct SRMediaEventsSensor : SRDataSensorpublic struct SRMediaEventsSensor : SRDataSensor {
public typealias Sample = SRMediaEvent
public init()
/// Returns a Boolean value indicating whether two values are equal.
///
/// Equality is the inverse of inequality. For any values `a` and `b`,
/// `a == b` implies that `a != b` is `false`.
///
/// - Parameters:
/// - lhs: A value to compare.
/// - rhs: Another value to compare.
public static func == (lhs: SRMediaEventsSensor, rhs: SRMediaEventsSensor) -> Bool
/// Hashes the essential components of this value by feeding them into the
/// given hasher.
///
/// Implement this method to conform to the `Hashable` protocol. The
/// components used for hashing must be the same as the components compared
/// in your type's `==` operator implementation. Call `hasher.combine(_:)`
/// with each of these components.
///
/// - Important: In your implementation of `hash(into:)`,
/// don't call `finalize()` on the `hasher` instance provided,
/// or replace it with a different instance.
/// Doing so may become a compile-time error in the future.
///
/// - Parameter hasher: The hasher to use when combining the components
/// of this instance.
public func hash(into hasher: inout Hasher)
/// The hash value.
///
/// Hash values are not guaranteed to be equal across different executions of
/// your program. Do not save hash values to use during a future execution.
///
/// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
/// conform to `Hashable`, implement the `hash(into:)` requirement instead.
/// The compiler provides an implementation for `hashValue` for you.
public var hashValue: Int { get }
}SRMessagesUsageSensorpublic struct SRMessagesUsageSensor : SRDataSensorpublic struct SRMessagesUsageSensor : SRDataSensor {
public typealias Sample = SRMessagesUsageReport
public init()
/// Returns a Boolean value indicating whether two values are equal.
///
/// Equality is the inverse of inequality. For any values `a` and `b`,
/// `a == b` implies that `a != b` is `false`.
///
/// - Parameters:
/// - lhs: A value to compare.
/// - rhs: Another value to compare.
public static func == (lhs: SRMessagesUsageSensor, rhs: SRMessagesUsageSensor) -> Bool
/// Hashes the essential components of this value by feeding them into the
/// given hasher.
///
/// Implement this method to conform to the `Hashable` protocol. The
/// components used for hashing must be the same as the components compared
/// in your type's `==` operator implementation. Call `hasher.combine(_:)`
/// with each of these components.
///
/// - Important: In your implementation of `hash(into:)`,
/// don't call `finalize()` on the `hasher` instance provided,
/// or replace it with a different instance.
/// Doing so may become a compile-time error in the future.
///
/// - Parameter hasher: The hasher to use when combining the components
/// of this instance.
public func hash(into hasher: inout Hasher)
/// The hash value.
///
/// Hash values are not guaranteed to be equal across different executions of
/// your program. Do not save hash values to use during a future execution.
///
/// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
/// conform to `Hashable`, implement the `hash(into:)` requirement instead.
/// The compiler provides an implementation for `hashValue` for you.
public var hashValue: Int { get }
}SROdometerSensorpublic struct SROdometerSensor : SRDataSensorpublic struct SROdometerSensor : SRDataSensor {
public typealias Sample = CMOdometerData
public init()
/// Returns a Boolean value indicating whether two values are equal.
///
/// Equality is the inverse of inequality. For any values `a` and `b`,
/// `a == b` implies that `a != b` is `false`.
///
/// - Parameters:
/// - lhs: A value to compare.
/// - rhs: Another value to compare.
public static func == (lhs: SROdometerSensor, rhs: SROdometerSensor) -> Bool
/// Hashes the essential components of this value by feeding them into the
/// given hasher.
///
/// Implement this method to conform to the `Hashable` protocol. The
/// components used for hashing must be the same as the components compared
/// in your type's `==` operator implementation. Call `hasher.combine(_:)`
/// with each of these components.
///
/// - Important: In your implementation of `hash(into:)`,
/// don't call `finalize()` on the `hasher` instance provided,
/// or replace it with a different instance.
/// Doing so may become a compile-time error in the future.
///
/// - Parameter hasher: The hasher to use when combining the components
/// of this instance.
public func hash(into hasher: inout Hasher)
/// The hash value.
///
/// Hash values are not guaranteed to be equal across different executions of
/// your program. Do not save hash values to use during a future execution.
///
/// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
/// conform to `Hashable`, implement the `hash(into:)` requirement instead.
/// The compiler provides an implementation for `hashValue` for you.
public var hashValue: Int { get }
}SROnWristStateSensorpublic struct SROnWristStateSensor : SRDataSensorpublic struct SROnWristStateSensor : SRDataSensor {
public typealias Sample = SRWristDetection
public init()
/// Returns a Boolean value indicating whether two values are equal.
///
/// Equality is the inverse of inequality. For any values `a` and `b`,
/// `a == b` implies that `a != b` is `false`.
///
/// - Parameters:
/// - lhs: A value to compare.
/// - rhs: Another value to compare.
public static func == (lhs: SROnWristStateSensor, rhs: SROnWristStateSensor) -> Bool
/// Hashes the essential components of this value by feeding them into the
/// given hasher.
///
/// Implement this method to conform to the `Hashable` protocol. The
/// components used for hashing must be the same as the components compared
/// in your type's `==` operator implementation. Call `hasher.combine(_:)`
/// with each of these components.
///
/// - Important: In your implementation of `hash(into:)`,
/// don't call `finalize()` on the `hasher` instance provided,
/// or replace it with a different instance.
/// Doing so may become a compile-time error in the future.
///
/// - Parameter hasher: The hasher to use when combining the components
/// of this instance.
public func hash(into hasher: inout Hasher)
/// The hash value.
///
/// Hash values are not guaranteed to be equal across different executions of
/// your program. Do not save hash values to use during a future execution.
///
/// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
/// conform to `Hashable`, implement the `hash(into:)` requirement instead.
/// The compiler provides an implementation for `hashValue` for you.
public var hashValue: Int { get }
}SRPedometerDataSensorpublic struct SRPedometerDataSensor : SRDataSensorpublic struct SRPedometerDataSensor : SRDataSensor {
public typealias Sample = CMPedometerData
public init()
/// Returns a Boolean value indicating whether two values are equal.
///
/// Equality is the inverse of inequality. For any values `a` and `b`,
/// `a == b` implies that `a != b` is `false`.
///
/// - Parameters:
/// - lhs: A value to compare.
/// - rhs: Another value to compare.
public static func == (lhs: SRPedometerDataSensor, rhs: SRPedometerDataSensor) -> Bool
/// Hashes the essential components of this value by feeding them into the
/// given hasher.
///
/// Implement this method to conform to the `Hashable` protocol. The
/// components used for hashing must be the same as the components compared
/// in your type's `==` operator implementation. Call `hasher.combine(_:)`
/// with each of these components.
///
/// - Important: In your implementation of `hash(into:)`,
/// don't call `finalize()` on the `hasher` instance provided,
/// or replace it with a different instance.
/// Doing so may become a compile-time error in the future.
///
/// - Parameter hasher: The hasher to use when combining the components
/// of this instance.
public func hash(into hasher: inout Hasher)
/// The hash value.
///
/// Hash values are not guaranteed to be equal across different executions of
/// your program. Do not save hash values to use during a future execution.
///
/// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
/// conform to `Hashable`, implement the `hash(into:)` requirement instead.
/// The compiler provides an implementation for `hashValue` for you.
public var hashValue: Int { get }
}SRPhoneUsageSensorpublic struct SRPhoneUsageSensor : SRDataSensorpublic struct SRPhoneUsageSensor : SRDataSensor {
public typealias Sample = SRPhoneUsageReport
public init()
/// Returns a Boolean value indicating whether two values are equal.
///
/// Equality is the inverse of inequality. For any values `a` and `b`,
/// `a == b` implies that `a != b` is `false`.
///
/// - Parameters:
/// - lhs: A value to compare.
/// - rhs: Another value to compare.
public static func == (lhs: SRPhoneUsageSensor, rhs: SRPhoneUsageSensor) -> Bool
/// Hashes the essential components of this value by feeding them into the
/// given hasher.
///
/// Implement this method to conform to the `Hashable` protocol. The
/// components used for hashing must be the same as the components compared
/// in your type's `==` operator implementation. Call `hasher.combine(_:)`
/// with each of these components.
///
/// - Important: In your implementation of `hash(into:)`,
/// don't call `finalize()` on the `hasher` instance provided,
/// or replace it with a different instance.
/// Doing so may become a compile-time error in the future.
///
/// - Parameter hasher: The hasher to use when combining the components
/// of this instance.
public func hash(into hasher: inout Hasher)
/// The hash value.
///
/// Hash values are not guaranteed to be equal across different executions of
/// your program. Do not save hash values to use during a future execution.
///
/// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
/// conform to `Hashable`, implement the `hash(into:)` requirement instead.
/// The compiler provides an implementation for `hashValue` for you.
public var hashValue: Int { get }
}SRPhotoplethysmogramSensorpublic struct SRPhotoplethysmogramSensor : SRDataSensorpublic struct SRPhotoplethysmogramSensor : SRDataSensor {
public typealias Sample = [SRPhotoplethysmogramSample]
public init()
/// Returns a Boolean value indicating whether two values are equal.
///
/// Equality is the inverse of inequality. For any values `a` and `b`,
/// `a == b` implies that `a != b` is `false`.
///
/// - Parameters:
/// - lhs: A value to compare.
/// - rhs: Another value to compare.
public static func == (lhs: SRPhotoplethysmogramSensor, rhs: SRPhotoplethysmogramSensor) -> Bool
/// Hashes the essential components of this value by feeding them into the
/// given hasher.
///
/// Implement this method to conform to the `Hashable` protocol. The
/// components used for hashing must be the same as the components compared
/// in your type's `==` operator implementation. Call `hasher.combine(_:)`
/// with each of these components.
///
/// - Important: In your implementation of `hash(into:)`,
/// don't call `finalize()` on the `hasher` instance provided,
/// or replace it with a different instance.
/// Doing so may become a compile-time error in the future.
///
/// - Parameter hasher: The hasher to use when combining the components
/// of this instance.
public func hash(into hasher: inout Hasher)
/// The hash value.
///
/// Hash values are not guaranteed to be equal across different executions of
/// your program. Do not save hash values to use during a future execution.
///
/// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
/// conform to `Hashable`, implement the `hash(into:)` requirement instead.
/// The compiler provides an implementation for `hashValue` for you.
public var hashValue: Int { get }
}SRReaderextension SRReader : nonisolated Observableextension SRReader : nonisolated Observable {
}SRRotationRateSensorpublic struct SRRotationRateSensor : SRDataSensorpublic struct SRRotationRateSensor : SRDataSensor {
public typealias Sample = [CMRecordedRotationRateData]
public init()
/// Returns a Boolean value indicating whether two values are equal.
///
/// Equality is the inverse of inequality. For any values `a` and `b`,
/// `a == b` implies that `a != b` is `false`.
///
/// - Parameters:
/// - lhs: A value to compare.
/// - rhs: Another value to compare.
public static func == (lhs: SRRotationRateSensor, rhs: SRRotationRateSensor) -> Bool
/// Hashes the essential components of this value by feeding them into the
/// given hasher.
///
/// Implement this method to conform to the `Hashable` protocol. The
/// components used for hashing must be the same as the components compared
/// in your type's `==` operator implementation. Call `hasher.combine(_:)`
/// with each of these components.
///
/// - Important: In your implementation of `hash(into:)`,
/// don't call `finalize()` on the `hasher` instance provided,
/// or replace it with a different instance.
/// Doing so may become a compile-time error in the future.
///
/// - Parameter hasher: The hasher to use when combining the components
/// of this instance.
public func hash(into hasher: inout Hasher)
/// The hash value.
///
/// Hash values are not guaranteed to be equal across different executions of
/// your program. Do not save hash values to use during a future execution.
///
/// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
/// conform to `Hashable`, implement the `hash(into:)` requirement instead.
/// The compiler provides an implementation for `hashValue` for you.
public var hashValue: Int { get }
}SRSiriSpeechMetricsSensorpublic struct SRSiriSpeechMetricsSensor : SRDataSensorpublic struct SRSiriSpeechMetricsSensor : SRDataSensor {
public typealias Sample = SRSpeechMetrics
public init()
/// Returns a Boolean value indicating whether two values are equal.
///
/// Equality is the inverse of inequality. For any values `a` and `b`,
/// `a == b` implies that `a != b` is `false`.
///
/// - Parameters:
/// - lhs: A value to compare.
/// - rhs: Another value to compare.
public static func == (lhs: SRSiriSpeechMetricsSensor, rhs: SRSiriSpeechMetricsSensor) -> Bool
/// Hashes the essential components of this value by feeding them into the
/// given hasher.
///
/// Implement this method to conform to the `Hashable` protocol. The
/// components used for hashing must be the same as the components compared
/// in your type's `==` operator implementation. Call `hasher.combine(_:)`
/// with each of these components.
///
/// - Important: In your implementation of `hash(into:)`,
/// don't call `finalize()` on the `hasher` instance provided,
/// or replace it with a different instance.
/// Doing so may become a compile-time error in the future.
///
/// - Parameter hasher: The hasher to use when combining the components
/// of this instance.
public func hash(into hasher: inout Hasher)
/// The hash value.
///
/// Hash values are not guaranteed to be equal across different executions of
/// your program. Do not save hash values to use during a future execution.
///
/// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
/// conform to `Hashable`, implement the `hash(into:)` requirement instead.
/// The compiler provides an implementation for `hashValue` for you.
public var hashValue: Int { get }
}SRSleepSessionsSensorpublic struct SRSleepSessionsSensor : SRDataSensorpublic struct SRSleepSessionsSensor : SRDataSensor {
public typealias Sample = SRSleepSession
public init()
/// Returns a Boolean value indicating whether two values are equal.
///
/// Equality is the inverse of inequality. For any values `a` and `b`,
/// `a == b` implies that `a != b` is `false`.
///
/// - Parameters:
/// - lhs: A value to compare.
/// - rhs: Another value to compare.
public static func == (lhs: SRSleepSessionsSensor, rhs: SRSleepSessionsSensor) -> Bool
/// Hashes the essential components of this value by feeding them into the
/// given hasher.
///
/// Implement this method to conform to the `Hashable` protocol. The
/// components used for hashing must be the same as the components compared
/// in your type's `==` operator implementation. Call `hasher.combine(_:)`
/// with each of these components.
///
/// - Important: In your implementation of `hash(into:)`,
/// don't call `finalize()` on the `hasher` instance provided,
/// or replace it with a different instance.
/// Doing so may become a compile-time error in the future.
///
/// - Parameter hasher: The hasher to use when combining the components
/// of this instance.
public func hash(into hasher: inout Hasher)
/// The hash value.
///
/// Hash values are not guaranteed to be equal across different executions of
/// your program. Do not save hash values to use during a future execution.
///
/// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
/// conform to `Hashable`, implement the `hash(into:)` requirement instead.
/// The compiler provides an implementation for `hashValue` for you.
public var hashValue: Int { get }
}SRTelephonySpeechMetricsSensorpublic struct SRTelephonySpeechMetricsSensor : SRDataSensorpublic struct SRTelephonySpeechMetricsSensor : SRDataSensor {
public typealias Sample = SRSpeechMetrics
public init()
/// Returns a Boolean value indicating whether two values are equal.
///
/// Equality is the inverse of inequality. For any values `a` and `b`,
/// `a == b` implies that `a != b` is `false`.
///
/// - Parameters:
/// - lhs: A value to compare.
/// - rhs: Another value to compare.
public static func == (lhs: SRTelephonySpeechMetricsSensor, rhs: SRTelephonySpeechMetricsSensor) -> Bool
/// Hashes the essential components of this value by feeding them into the
/// given hasher.
///
/// Implement this method to conform to the `Hashable` protocol. The
/// components used for hashing must be the same as the components compared
/// in your type's `==` operator implementation. Call `hasher.combine(_:)`
/// with each of these components.
///
/// - Important: In your implementation of `hash(into:)`,
/// don't call `finalize()` on the `hasher` instance provided,
/// or replace it with a different instance.
/// Doing so may become a compile-time error in the future.
///
/// - Parameter hasher: The hasher to use when combining the components
/// of this instance.
public func hash(into hasher: inout Hasher)
/// The hash value.
///
/// Hash values are not guaranteed to be equal across different executions of
/// your program. Do not save hash values to use during a future execution.
///
/// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
/// conform to `Hashable`, implement the `hash(into:)` requirement instead.
/// The compiler provides an implementation for `hashValue` for you.
public var hashValue: Int { get }
}SRVisitsSensorpublic struct SRVisitsSensor : SRDataSensorpublic struct SRVisitsSensor : SRDataSensor {
public typealias Sample = SRVisit
public init()
/// Returns a Boolean value indicating whether two values are equal.
///
/// Equality is the inverse of inequality. For any values `a` and `b`,
/// `a == b` implies that `a != b` is `false`.
///
/// - Parameters:
/// - lhs: A value to compare.
/// - rhs: Another value to compare.
public static func == (lhs: SRVisitsSensor, rhs: SRVisitsSensor) -> Bool
/// Hashes the essential components of this value by feeding them into the
/// given hasher.
///
/// Implement this method to conform to the `Hashable` protocol. The
/// components used for hashing must be the same as the components compared
/// in your type's `==` operator implementation. Call `hasher.combine(_:)`
/// with each of these components.
///
/// - Important: In your implementation of `hash(into:)`,
/// don't call `finalize()` on the `hasher` instance provided,
/// or replace it with a different instance.
/// Doing so may become a compile-time error in the future.
///
/// - Parameter hasher: The hasher to use when combining the components
/// of this instance.
public func hash(into hasher: inout Hasher)
/// The hash value.
///
/// Hash values are not guaranteed to be equal across different executions of
/// your program. Do not save hash values to use during a future execution.
///
/// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
/// conform to `Hashable`, implement the `hash(into:)` requirement instead.
/// The compiler provides an implementation for `hashValue` for you.
public var hashValue: Int { get }
}SRWristTemperatureSensorpublic struct SRWristTemperatureSensor : SRDataSensorpublic struct SRWristTemperatureSensor : SRDataSensor {
public typealias Sample = SRWristTemperatureSession
public init()
/// Returns a Boolean value indicating whether two values are equal.
///
/// Equality is the inverse of inequality. For any values `a` and `b`,
/// `a == b` implies that `a != b` is `false`.
///
/// - Parameters:
/// - lhs: A value to compare.
/// - rhs: Another value to compare.
public static func == (lhs: SRWristTemperatureSensor, rhs: SRWristTemperatureSensor) -> Bool
/// Hashes the essential components of this value by feeding them into the
/// given hasher.
///
/// Implement this method to conform to the `Hashable` protocol. The
/// components used for hashing must be the same as the components compared
/// in your type's `==` operator implementation. Call `hasher.combine(_:)`
/// with each of these components.
///
/// - Important: In your implementation of `hash(into:)`,
/// don't call `finalize()` on the `hasher` instance provided,
/// or replace it with a different instance.
/// Doing so may become a compile-time error in the future.
///
/// - Parameter hasher: The hasher to use when combining the components
/// of this instance.
public func hash(into hasher: inout Hasher)
/// The hash value.
///
/// Hash values are not guaranteed to be equal across different executions of
/// your program. Do not save hash values to use during a future execution.
///
/// - Important: `hashValue` is deprecated as a `Hashable` requirement. To
/// conform to `Hashable`, implement the `hash(into:)` requirement instead.
/// The compiler provides an implementation for `hashValue` for you.
public var hashValue: Int { get }
}SRHeadphoneSettings.AdaptiveAudioStrengthpublic enum AdaptiveAudioStrength : UInt32, @unchecked Sendablepublic enum AdaptiveAudioStrength : UInt32, @unchecked Sendable {
case low = 1
case medium = 2
case high = 3
}SRHeadphoneSettings.ListeningModepublic enum ListeningMode : Int, @unchecked Sendablepublic enum ListeningMode : Int, @unchecked Sendable {
case normal = 1
case activeNoiseCancelling = 2
case transparency = 3
case autoActiveNoiseCancelling = 4
}SRHeadphoneSettings.SettingEnablementpublic enum SettingEnablement : Int, @unchecked Sendablepublic enum SettingEnablement : Int, @unchecked Sendable {
case unsupported = 0
case enabled = 1
case disabled = 2
}SRSensor.headphoneMotionpublic static let headphoneMotion: SRSensorSRSensor.headphoneSettingspublic static let headphoneSettings: SRSensorNSStringextension NSStringextension NSString {
/**
* @brief Returns a sensor stream that contains deletion records of the sensor
*
* @discussion This sensor stream should only be used for fetching. All other
* operations will be ignored. Deletion records share the recording and authorization
* state with their parent sensor.
*
* @return May return nil if there is no deletion record available for this sensor
*/
open func sr_sensorForDeletionRecordsFromSensor() -> SRSensor?
}SRSensorReaderDelegatepublic protocol SRSensorReaderDelegate : NSObjectProtocolpublic protocol SRSensorReaderDelegate : NSObjectProtocol {
/**
* @brief Invoked when a sample has been fetched
*
* @description This callback can be called multiple times
* when there are multiple results.
*
* @param fetchRequest The request corresponding to the this result
* @param result One result of the fetch. The caller is expected to
* know what type of sample is returned.
*
* @note The fetchResult is not valid after the callback is complete. If the caller needs
* to access the result at a later time, it must be copied not merely retained
*
* @return
* The delegate should return YES if the fetch should continue, NO if the fetch should stop
*/
optional func sensorReader(_ reader: SRSensorReader, fetching fetchRequest: SRFetchRequest, didFetchResult result: SRFetchResult<AnyObject>) -> Bool
/**
* @brief Invoked when a fetch has been completed successfully
*/
optional func sensorReader(_ reader: SRSensorReader, didCompleteFetch fetchRequest: SRFetchRequest)
/**
* @brief Invoked when a fetch has completed with an error
*/
optional func sensorReader(_ reader: SRSensorReader, fetching fetchRequest: SRFetchRequest, failedWithError error: any Error)
/**
* @brief Invoked when authorization status has changed
*/
optional func sensorReader(_ reader: SRSensorReader, didChange authorizationStatus: SRAuthorizationStatus)
/**
* @brief Invoked after a SRSensorReader has request that recording be
* started for a sensor
*/
optional func sensorReaderWillStartRecording(_ reader: SRSensorReader)
/**
* @brief Invoked if there was an error starting recording for a given sensor
*/
optional func sensorReader(_ reader: SRSensorReader, startRecordingFailedWithError error: any Error)
/**
* @brief Invoked after a SRSensorReader has request that recording be
* stopped for a sensor
*/
optional func sensorReaderDidStopRecording(_ reader: SRSensorReader)
/**
* @brief Invoked if there was an error starting recording for a given sensor
*/
optional func sensorReader(_ reader: SRSensorReader, stopRecordingFailedWithError error: any Error)
optional func sensorReader(_ reader: SRSensorReader, didFetch devices: [SRDevice])
optional func sensorReader(_ reader: SRSensorReader, fetchDevicesDidFailWithError error: any Error)
}No APIs match your filter.