CoreMotion Changes for Swift
CoreMotion
Removed CMAttitudeReferenceFrame.init(_: UInt)
Removed CMError.value
Removed CMMagneticFieldCalibrationAccuracy.value
Added CMError.init(rawValue: UInt32)
Added CMError.rawValue
Added CMMagneticFieldCalibrationAccuracy.init(rawValue: Int32)
Added CMMagneticFieldCalibrationAccuracy.rawValue
Added CMSensorDataList
Added CMSensorRecorder
Added CMSensorRecorder.accelerometerDataFrom(_: NSDate, to: NSDate) -> CMSensorDataList?
Added CMSensorRecorder.recordAccelerometerFor(_: NSTimeInterval)
Modified CMAltimeter
Declaration | |
---|---|
From | class CMAltimeter : NSObject { class func isRelativeAltitudeAvailable() -> Bool func startRelativeAltitudeUpdatesToQueue(_ queue: NSOperationQueue!, withHandler handler: CMAltitudeHandler!) func stopRelativeAltitudeUpdates() } |
To | class CMAltimeter : NSObject { class func isRelativeAltitudeAvailable() -> Bool func startRelativeAltitudeUpdatesToQueue(_ queue: NSOperationQueue, withHandler handler: CMAltitudeHandler) func stopRelativeAltitudeUpdates() } |
Modified CMAltimeter.startRelativeAltitudeUpdatesToQueue(_: NSOperationQueue, withHandler: CMAltitudeHandler)
Declaration | |
---|---|
From | func startRelativeAltitudeUpdatesToQueue(_ queue: NSOperationQueue!, withHandler handler: CMAltitudeHandler!) |
To | func startRelativeAltitudeUpdatesToQueue(_ queue: NSOperationQueue, withHandler handler: CMAltitudeHandler) |
Modified CMAltitudeData
Declaration | |
---|---|
From | class CMAltitudeData : CMLogItem { var relativeAltitude: NSNumber! { get } var pressure: NSNumber! { get } } |
To | class CMAltitudeData : CMLogItem { var relativeAltitude: NSNumber { get } var pressure: NSNumber { get } } |
Modified CMAltitudeData.pressure
Declaration | |
---|---|
From | var pressure: NSNumber! { get } |
To | var pressure: NSNumber { get } |
Modified CMAltitudeData.relativeAltitude
Declaration | |
---|---|
From | var relativeAltitude: NSNumber! { get } |
To | var relativeAltitude: NSNumber { get } |
Modified CMAttitude
Declaration | |
---|---|
From | class CMAttitude : NSObject, NSCopying, NSSecureCoding, NSCoding { var roll: Double { get } var pitch: Double { get } var yaw: Double { get } var rotationMatrix: CMRotationMatrix { get } var quaternion: CMQuaternion { get } func multiplyByInverseOfAttitude(_ attitude: CMAttitude!) } |
To | class CMAttitude : NSObject, NSCopying, NSSecureCoding, NSCoding { var roll: Double { get } var pitch: Double { get } var yaw: Double { get } var rotationMatrix: CMRotationMatrix { get } var quaternion: CMQuaternion { get } func multiplyByInverseOfAttitude(_ attitude: CMAttitude) } |
Declaration | |
---|---|
From | func multiplyByInverseOfAttitude(_ attitude: CMAttitude!) |
To | func multiplyByInverseOfAttitude(_ attitude: CMAttitude) |
Modified CMAttitudeReferenceFrame [struct]
Declaration | Protocols | |
---|---|---|
From | struct CMAttitudeReferenceFrame : RawOptionSetType { init(_ rawValue: UInt) init(rawValue rawValue: UInt) static var XArbitraryZVertical: CMAttitudeReferenceFrame { get } static var XArbitraryCorrectedZVertical: CMAttitudeReferenceFrame { get } static var XMagneticNorthZVertical: CMAttitudeReferenceFrame { get } static var XTrueNorthZVertical: CMAttitudeReferenceFrame { get } } | RawOptionSetType |
To | struct CMAttitudeReferenceFrame : OptionSetType { init(rawValue rawValue: UInt) static var XArbitraryZVertical: CMAttitudeReferenceFrame { get } static var XArbitraryCorrectedZVertical: CMAttitudeReferenceFrame { get } static var XMagneticNorthZVertical: CMAttitudeReferenceFrame { get } static var XTrueNorthZVertical: CMAttitudeReferenceFrame { get } } | OptionSetType |
Modified CMDeviceMotion
Declaration | |
---|---|
From | class CMDeviceMotion : CMLogItem { var attitude: CMAttitude! { get } var rotationRate: CMRotationRate { get } var gravity: CMAcceleration { get } var userAcceleration: CMAcceleration { get } var magneticField: CMCalibratedMagneticField { get } } |
To | class CMDeviceMotion : CMLogItem { var attitude: CMAttitude { get } var rotationRate: CMRotationRate { get } var gravity: CMAcceleration { get } var userAcceleration: CMAcceleration { get } var magneticField: CMCalibratedMagneticField { get } } |
Modified CMDeviceMotion.attitude
Declaration | |
---|---|
From | var attitude: CMAttitude! { get } |
To | var attitude: CMAttitude { get } |
Modified CMError [struct]
Declaration | Protocols | |
---|---|---|
From | struct CMError { init(_ value: UInt32) var value: UInt32 } | -- |
To | struct CMError : RawRepresentable { init(_ rawValue: UInt32) init(rawValue rawValue: UInt32) var rawValue: UInt32 } | RawRepresentable |
Declaration | Protocols | |
---|---|---|
From | struct CMMagneticFieldCalibrationAccuracy { init(_ value: Int32) var value: Int32 } | -- |
To | struct CMMagneticFieldCalibrationAccuracy : RawRepresentable { init(_ rawValue: Int32) init(rawValue rawValue: Int32) var rawValue: Int32 } | RawRepresentable |
Modified CMMotionActivity
Declaration | |
---|---|
From | class CMMotionActivity : CMLogItem { var confidence: CMMotionActivityConfidence { get } var startDate: NSDate! { get } var unknown: Bool { get } var stationary: Bool { get } var walking: Bool { get } var running: Bool { get } var automotive: Bool { get } var cycling: Bool { get } } |
To | class CMMotionActivity : CMLogItem { var confidence: CMMotionActivityConfidence { get } var startDate: NSDate { get } var unknown: Bool { get } var stationary: Bool { get } var walking: Bool { get } var running: Bool { get } var automotive: Bool { get } var cycling: Bool { get } } |
Modified CMMotionActivity.startDate
Declaration | |
---|---|
From | var startDate: NSDate! { get } |
To | var startDate: NSDate { get } |
Modified CMMotionActivityConfidence [enum]
Raw Value Type | |
---|---|
From | -- |
To | Int |
Modified CMMotionActivityManager
Declaration | |
---|---|
From | class CMMotionActivityManager : NSObject { class func isActivityAvailable() -> Bool func queryActivityStartingFromDate(_ start: NSDate!, toDate end: NSDate!, toQueue queue: NSOperationQueue!, withHandler handler: CMMotionActivityQueryHandler!) func startActivityUpdatesToQueue(_ queue: NSOperationQueue!, withHandler handler: CMMotionActivityHandler!) func stopActivityUpdates() } |
To | class CMMotionActivityManager : NSObject { class func isActivityAvailable() -> Bool func queryActivityStartingFromDate(_ start: NSDate, toDate end: NSDate, toQueue queue: NSOperationQueue, withHandler handler: CMMotionActivityQueryHandler) func startActivityUpdatesToQueue(_ queue: NSOperationQueue, withHandler handler: CMMotionActivityHandler) func stopActivityUpdates() } |
Declaration | |
---|---|
From | func queryActivityStartingFromDate(_ start: NSDate!, toDate end: NSDate!, toQueue queue: NSOperationQueue!, withHandler handler: CMMotionActivityQueryHandler!) |
To | func queryActivityStartingFromDate(_ start: NSDate, toDate end: NSDate, toQueue queue: NSOperationQueue, withHandler handler: CMMotionActivityQueryHandler) |
Declaration | |
---|---|
From | func startActivityUpdatesToQueue(_ queue: NSOperationQueue!, withHandler handler: CMMotionActivityHandler!) |
To | func startActivityUpdatesToQueue(_ queue: NSOperationQueue, withHandler handler: CMMotionActivityHandler) |
Modified CMMotionManager
Declaration | |
---|---|
From | class CMMotionManager : NSObject { var accelerometerUpdateInterval: NSTimeInterval var accelerometerAvailable: Bool { get } var accelerometerActive: Bool { get } var accelerometerData: CMAccelerometerData! { get } func startAccelerometerUpdates() func startAccelerometerUpdatesToQueue(_ queue: NSOperationQueue!, withHandler handler: CMAccelerometerHandler!) func stopAccelerometerUpdates() var gyroUpdateInterval: NSTimeInterval var gyroAvailable: Bool { get } var gyroActive: Bool { get } var gyroData: CMGyroData! { get } func startGyroUpdates() func startGyroUpdatesToQueue(_ queue: NSOperationQueue!, withHandler handler: CMGyroHandler!) func stopGyroUpdates() var magnetometerUpdateInterval: NSTimeInterval var magnetometerAvailable: Bool { get } var magnetometerActive: Bool { get } var magnetometerData: CMMagnetometerData! { get } func startMagnetometerUpdates() func startMagnetometerUpdatesToQueue(_ queue: NSOperationQueue!, withHandler handler: CMMagnetometerHandler!) func stopMagnetometerUpdates() var deviceMotionUpdateInterval: NSTimeInterval class func availableAttitudeReferenceFrames() -> CMAttitudeReferenceFrame var attitudeReferenceFrame: CMAttitudeReferenceFrame { get } var deviceMotionAvailable: Bool { get } var deviceMotionActive: Bool { get } var deviceMotion: CMDeviceMotion! { get } func startDeviceMotionUpdates() func startDeviceMotionUpdatesToQueue(_ queue: NSOperationQueue!, withHandler handler: CMDeviceMotionHandler!) func startDeviceMotionUpdatesUsingReferenceFrame(_ referenceFrame: CMAttitudeReferenceFrame) func startDeviceMotionUpdatesUsingReferenceFrame(_ referenceFrame: CMAttitudeReferenceFrame, toQueue queue: NSOperationQueue!, withHandler handler: CMDeviceMotionHandler!) func stopDeviceMotionUpdates() var showsDeviceMovementDisplay: Bool } |
To | class CMMotionManager : NSObject { var accelerometerUpdateInterval: NSTimeInterval var accelerometerAvailable: Bool { get } var accelerometerActive: Bool { get } var accelerometerData: CMAccelerometerData? { get } func startAccelerometerUpdates() func startAccelerometerUpdatesToQueue(_ queue: NSOperationQueue, withHandler handler: CMAccelerometerHandler) func stopAccelerometerUpdates() var gyroUpdateInterval: NSTimeInterval var gyroAvailable: Bool { get } var gyroActive: Bool { get } var gyroData: CMGyroData? { get } func startGyroUpdates() func startGyroUpdatesToQueue(_ queue: NSOperationQueue, withHandler handler: CMGyroHandler) func stopGyroUpdates() var magnetometerUpdateInterval: NSTimeInterval var magnetometerAvailable: Bool { get } var magnetometerActive: Bool { get } var magnetometerData: CMMagnetometerData? { get } func startMagnetometerUpdates() func startMagnetometerUpdatesToQueue(_ queue: NSOperationQueue, withHandler handler: CMMagnetometerHandler) func stopMagnetometerUpdates() var deviceMotionUpdateInterval: NSTimeInterval class func availableAttitudeReferenceFrames() -> CMAttitudeReferenceFrame var attitudeReferenceFrame: CMAttitudeReferenceFrame { get } var deviceMotionAvailable: Bool { get } var deviceMotionActive: Bool { get } var deviceMotion: CMDeviceMotion? { get } func startDeviceMotionUpdates() func startDeviceMotionUpdatesToQueue(_ queue: NSOperationQueue, withHandler handler: CMDeviceMotionHandler) func startDeviceMotionUpdatesUsingReferenceFrame(_ referenceFrame: CMAttitudeReferenceFrame) func startDeviceMotionUpdatesUsingReferenceFrame(_ referenceFrame: CMAttitudeReferenceFrame, toQueue queue: NSOperationQueue, withHandler handler: CMDeviceMotionHandler) func stopDeviceMotionUpdates() var showsDeviceMovementDisplay: Bool } |
Modified CMMotionManager.accelerometerData
Declaration | |
---|---|
From | var accelerometerData: CMAccelerometerData! { get } |
To | var accelerometerData: CMAccelerometerData? { get } |
Modified CMMotionManager.deviceMotion
Declaration | |
---|---|
From | var deviceMotion: CMDeviceMotion! { get } |
To | var deviceMotion: CMDeviceMotion? { get } |
Modified CMMotionManager.gyroData
Declaration | |
---|---|
From | var gyroData: CMGyroData! { get } |
To | var gyroData: CMGyroData? { get } |
Modified CMMotionManager.magnetometerData
Declaration | |
---|---|
From | var magnetometerData: CMMagnetometerData! { get } |
To | var magnetometerData: CMMagnetometerData? { get } |
Declaration | |
---|---|
From | func startAccelerometerUpdatesToQueue(_ queue: NSOperationQueue!, withHandler handler: CMAccelerometerHandler!) |
To | func startAccelerometerUpdatesToQueue(_ queue: NSOperationQueue, withHandler handler: CMAccelerometerHandler) |
Declaration | |
---|---|
From | func startDeviceMotionUpdatesToQueue(_ queue: NSOperationQueue!, withHandler handler: CMDeviceMotionHandler!) |
To | func startDeviceMotionUpdatesToQueue(_ queue: NSOperationQueue, withHandler handler: CMDeviceMotionHandler) |
Declaration | |
---|---|
From | func startDeviceMotionUpdatesUsingReferenceFrame(_ referenceFrame: CMAttitudeReferenceFrame, toQueue queue: NSOperationQueue!, withHandler handler: CMDeviceMotionHandler!) |
To | func startDeviceMotionUpdatesUsingReferenceFrame(_ referenceFrame: CMAttitudeReferenceFrame, toQueue queue: NSOperationQueue, withHandler handler: CMDeviceMotionHandler) |
Declaration | |
---|---|
From | func startGyroUpdatesToQueue(_ queue: NSOperationQueue!, withHandler handler: CMGyroHandler!) |
To | func startGyroUpdatesToQueue(_ queue: NSOperationQueue, withHandler handler: CMGyroHandler) |
Declaration | |
---|---|
From | func startMagnetometerUpdatesToQueue(_ queue: NSOperationQueue!, withHandler handler: CMMagnetometerHandler!) |
To | func startMagnetometerUpdatesToQueue(_ queue: NSOperationQueue, withHandler handler: CMMagnetometerHandler) |
Modified CMPedometer
Declaration | |
---|---|
From | class CMPedometer : NSObject { class func isStepCountingAvailable() -> Bool class func isDistanceAvailable() -> Bool class func isFloorCountingAvailable() -> Bool func queryPedometerDataFromDate(_ start: NSDate!, toDate end: NSDate!, withHandler handler: CMPedometerHandler!) func startPedometerUpdatesFromDate(_ start: NSDate!, withHandler handler: CMPedometerHandler!) func stopPedometerUpdates() } |
To | class CMPedometer : NSObject { class func isStepCountingAvailable() -> Bool class func isDistanceAvailable() -> Bool class func isFloorCountingAvailable() -> Bool class func isPaceAvailable() -> Bool class func isCadenceAvailable() -> Bool func queryPedometerDataFromDate(_ start: NSDate, toDate end: NSDate, withHandler handler: CMPedometerHandler) func startPedometerUpdatesFromDate(_ start: NSDate, withHandler handler: CMPedometerHandler) func stopPedometerUpdates() } |
Modified CMPedometer.queryPedometerDataFromDate(_: NSDate, toDate: NSDate, withHandler: CMPedometerHandler)
Declaration | |
---|---|
From | func queryPedometerDataFromDate(_ start: NSDate!, toDate end: NSDate!, withHandler handler: CMPedometerHandler!) |
To | func queryPedometerDataFromDate(_ start: NSDate, toDate end: NSDate, withHandler handler: CMPedometerHandler) |
Declaration | |
---|---|
From | func startPedometerUpdatesFromDate(_ start: NSDate!, withHandler handler: CMPedometerHandler!) |
To | func startPedometerUpdatesFromDate(_ start: NSDate, withHandler handler: CMPedometerHandler) |
Modified CMPedometerData
Declaration | |
---|---|
From | class CMPedometerData : NSObject, NSSecureCoding, NSCoding, NSCopying { var startDate: NSDate! { get } var endDate: NSDate! { get } var numberOfSteps: NSNumber! { get } var distance: NSNumber! { get } var floorsAscended: NSNumber! { get } var floorsDescended: NSNumber! { get } } |
To | class CMPedometerData : NSObject, NSSecureCoding, NSCoding, NSCopying { var startDate: NSDate { get } var endDate: NSDate { get } var numberOfSteps: NSNumber { get } var distance: NSNumber? { get } var floorsAscended: NSNumber? { get } var floorsDescended: NSNumber? { get } var currentPace: NSNumber? { get } var currentCadence: NSNumber? { get } } |
Modified CMPedometerData.distance
Declaration | |
---|---|
From | var distance: NSNumber! { get } |
To | var distance: NSNumber? { get } |
Modified CMPedometerData.endDate
Declaration | |
---|---|
From | var endDate: NSDate! { get } |
To | var endDate: NSDate { get } |
Modified CMPedometerData.floorsAscended
Declaration | |
---|---|
From | var floorsAscended: NSNumber! { get } |
To | var floorsAscended: NSNumber? { get } |
Modified CMPedometerData.floorsDescended
Declaration | |
---|---|
From | var floorsDescended: NSNumber! { get } |
To | var floorsDescended: NSNumber? { get } |
Modified CMPedometerData.numberOfSteps
Declaration | |
---|---|
From | var numberOfSteps: NSNumber! { get } |
To | var numberOfSteps: NSNumber { get } |
Modified CMPedometerData.startDate
Declaration | |
---|---|
From | var startDate: NSDate! { get } |
To | var startDate: NSDate { get } |
Modified CMStepCounter
Declaration | |
---|---|
From | class CMStepCounter : NSObject { class func isStepCountingAvailable() -> Bool func queryStepCountStartingFrom(_ start: NSDate!, to end: NSDate!, toQueue queue: NSOperationQueue!, withHandler handler: CMStepQueryHandler!) func startStepCountingUpdatesToQueue(_ queue: NSOperationQueue!, updateOn stepCounts: Int, withHandler handler: CMStepUpdateHandler!) func stopStepCountingUpdates() } |
To | class CMStepCounter : NSObject { class func isStepCountingAvailable() -> Bool func queryStepCountStartingFrom(_ start: NSDate, to end: NSDate, toQueue queue: NSOperationQueue, withHandler handler: CMStepQueryHandler) func startStepCountingUpdatesToQueue(_ queue: NSOperationQueue, updateOn stepCounts: Int, withHandler handler: CMStepUpdateHandler) func stopStepCountingUpdates() } |
Declaration | |
---|---|
From | func queryStepCountStartingFrom(_ start: NSDate!, to end: NSDate!, toQueue queue: NSOperationQueue!, withHandler handler: CMStepQueryHandler!) |
To | func queryStepCountStartingFrom(_ start: NSDate, to end: NSDate, toQueue queue: NSOperationQueue, withHandler handler: CMStepQueryHandler) |
Declaration | |
---|---|
From | func startStepCountingUpdatesToQueue(_ queue: NSOperationQueue!, updateOn stepCounts: Int, withHandler handler: CMStepUpdateHandler!) |
To | func startStepCountingUpdatesToQueue(_ queue: NSOperationQueue, updateOn stepCounts: Int, withHandler handler: CMStepUpdateHandler) |
Modified CMAccelerometerHandler
Declaration | |
---|---|
From | typealias CMAccelerometerHandler = (CMAccelerometerData!, NSError!) -> Void |
To | typealias CMAccelerometerHandler = (CMAccelerometerData?, NSError?) -> Void |
Modified CMAltitudeHandler
Declaration | |
---|---|
From | typealias CMAltitudeHandler = (CMAltitudeData!, NSError!) -> Void |
To | typealias CMAltitudeHandler = (CMAltitudeData?, NSError?) -> Void |
Modified CMDeviceMotionHandler
Declaration | |
---|---|
From | typealias CMDeviceMotionHandler = (CMDeviceMotion!, NSError!) -> Void |
To | typealias CMDeviceMotionHandler = (CMDeviceMotion?, NSError?) -> Void |
Modified CMGyroHandler
Declaration | |
---|---|
From | typealias CMGyroHandler = (CMGyroData!, NSError!) -> Void |
To | typealias CMGyroHandler = (CMGyroData?, NSError?) -> Void |
Modified CMMagnetometerHandler
Declaration | |
---|---|
From | typealias CMMagnetometerHandler = (CMMagnetometerData!, NSError!) -> Void |
To | typealias CMMagnetometerHandler = (CMMagnetometerData?, NSError?) -> Void |
Modified CMMotionActivityHandler
Declaration | |
---|---|
From | typealias CMMotionActivityHandler = (CMMotionActivity!) -> Void |
To | typealias CMMotionActivityHandler = (CMMotionActivity?) -> Void |
Modified CMMotionActivityQueryHandler
Declaration | |
---|---|
From | typealias CMMotionActivityQueryHandler = ([AnyObject]!, NSError!) -> Void |
To | typealias CMMotionActivityQueryHandler = ([CMMotionActivity]?, NSError?) -> Void |
Modified CMPedometerHandler
Declaration | |
---|---|
From | typealias CMPedometerHandler = (CMPedometerData!, NSError!) -> Void |
To | typealias CMPedometerHandler = (CMPedometerData?, NSError?) -> Void |
Modified CMStepQueryHandler
Declaration | |
---|---|
From | typealias CMStepQueryHandler = (Int, NSError!) -> Void |
To | typealias CMStepQueryHandler = (Int, NSError?) -> Void |
Modified CMStepUpdateHandler
Declaration | |
---|---|
From | typealias CMStepUpdateHandler = (Int, NSDate!, NSError!) -> Void |
To | typealias CMStepUpdateHandler = (Int, NSDate, NSError?) -> Void |