Documentation Archive Developer
Search

HealthKit Changes for Swift

HealthKit

Protocols
FromAnyObject
To--

Protocols
FromEquatable, Hashable, RawRepresentable
To--

Protocols
FromEquatable, Hashable, RawRepresentable
To--

DeclarationProtocols
From
class HKBiologicalSexObject : NSObject, NSCopying, NSSecureCoding, NSCoding {
    var biologicalSex: HKBiologicalSex { get }
}
AnyObject, NSCoding, NSCopying, NSSecureCoding
To
class HKBiologicalSexObject : NSObject, NSCopying, NSSecureCoding {
    var biologicalSex: HKBiologicalSex { get }
}
NSCopying, NSSecureCoding

Protocols
FromEquatable, Hashable, RawRepresentable
To--

DeclarationProtocols
From
class HKBloodTypeObject : NSObject, NSCopying, NSSecureCoding, NSCoding {
    var bloodType: HKBloodType { get }
}
AnyObject, NSCoding, NSCopying, NSSecureCoding
To
class HKBloodTypeObject : NSObject, NSCopying, NSSecureCoding {
    var bloodType: HKBloodType { get }
}
NSCopying, NSSecureCoding

Protocols
FromEquatable, Hashable, RawRepresentable
To--

Protocols
FromAnyObject
To--

Protocols
FromAnyObject
To--

Protocols
FromEquatable, Hashable, RawRepresentable
To--

Protocols
FromEquatable, Hashable, RawRepresentable
To--

Protocols
FromEquatable, Hashable, RawRepresentable
To--

Protocols
FromEquatable, Hashable, RawRepresentable
To--

Protocols
FromEquatable, Hashable, RawRepresentable
To--

Protocols
FromEquatable, Hashable, RawRepresentable
To--

Protocols
FromAnyObject
To--

Modified HKCorrelation
Protocols
FromAnyObject
To--

Protocols
FromAnyObject
To--

Protocols
FromAnyObject
To--

DeclarationProtocols
From
class HKDeletedObject : NSObject, NSSecureCoding, NSCoding {
    var UUID: NSUUID { get }
    init()
}
AnyObject, NSCoding, NSSecureCoding
To
class HKDeletedObject : NSObject, NSSecureCoding {
    var UUID: NSUUID { get }
    init()
}
NSSecureCoding

Modified HKDevice
DeclarationProtocols
From
class HKDevice : NSObject, NSSecureCoding, NSCoding, NSCopying {
    var name: String { get }
    var manufacturer: String? { get }
    var model: String? { get }
    var hardwareVersion: String? { get }
    var firmwareVersion: String? { get }
    var softwareVersion: String? { get }
    var localIdentifier: String? { get }
    var UDIDeviceIdentifier: String? { get }
    init(name name: String?, manufacturer manufacturer: String?, model model: String?, hardwareVersion hardwareVersion: String?, firmwareVersion firmwareVersion: String?, softwareVersion softwareVersion: String?, localIdentifier localIdentifier: String?, UDIDeviceIdentifier UDIDeviceIdentifier: String?)
    init()
    class func localDevice() -> HKDevice
}
AnyObject, NSCoding, NSCopying, NSSecureCoding
To
class HKDevice : NSObject, NSSecureCoding, NSCopying {
    var name: String { get }
    var manufacturer: String? { get }
    var model: String? { get }
    var hardwareVersion: String? { get }
    var firmwareVersion: String? { get }
    var softwareVersion: String? { get }
    var localIdentifier: String? { get }
    var UDIDeviceIdentifier: String? { get }
    init(name name: String?, manufacturer manufacturer: String?, model model: String?, hardwareVersion hardwareVersion: String?, firmwareVersion firmwareVersion: String?, softwareVersion softwareVersion: String?, localIdentifier localIdentifier: String?, UDIDeviceIdentifier UDIDeviceIdentifier: String?)
    init()
    class func localDevice() -> HKDevice
}
NSCopying, NSSecureCoding

Protocols
FromEquatable, Hashable, RawRepresentable
To--

Protocols
FromEquatable, Hashable, RawRepresentable
To--

DeclarationProtocols
From
class HKFitzpatrickSkinTypeObject : NSObject, NSCopying, NSSecureCoding, NSCoding {
    var skinType: HKFitzpatrickSkinType { get }
}
AnyObject, NSCoding, NSCopying, NSSecureCoding
To
class HKFitzpatrickSkinTypeObject : NSObject, NSCopying, NSSecureCoding {
    var skinType: HKFitzpatrickSkinType { get }
}
NSCopying, NSSecureCoding

Modified HKHealthStore
Protocols
FromAnyObject
To--

Protocols
FromEquatable, Hashable, RawRepresentable
To--

Protocols
FromEquatable, Hashable, RawRepresentable
To--

Modified HKObject
DeclarationProtocols
From
class HKObject : NSObject, NSSecureCoding, NSCoding {
    var UUID: NSUUID { get }
    var source: HKSource { get }
    var sourceRevision: HKSourceRevision { get }
    var device: HKDevice? { get }
    var metadata: [String : AnyObject]? { get }
    init()
}
AnyObject, NSCoding, NSSecureCoding
To
class HKObject : NSObject, NSSecureCoding {
    var UUID: NSUUID { get }
    var source: HKSource { get }
    var sourceRevision: HKSourceRevision { get }
    var device: HKDevice? { get }
    var metadata: [String : AnyObject]? { get }
    init()
}
NSSecureCoding

Modified HKObjectType
DeclarationProtocols
From
class HKObjectType : NSObject, NSSecureCoding, NSCoding, NSCopying {
    var identifier: String { get }
    init()
    class func quantityTypeForIdentifier(_ identifier: String) -> HKQuantityType?
    class func categoryTypeForIdentifier(_ identifier: String) -> HKCategoryType?
    class func characteristicTypeForIdentifier(_ identifier: String) -> HKCharacteristicType?
    class func correlationTypeForIdentifier(_ identifier: String) -> HKCorrelationType?
    class func workoutType() -> HKWorkoutType
}
AnyObject, NSCoding, NSCopying, NSSecureCoding
To
class HKObjectType : NSObject, NSSecureCoding, NSCopying {
    var identifier: String { get }
    init()
    class func quantityTypeForIdentifier(_ identifier: String) -> HKQuantityType?
    class func categoryTypeForIdentifier(_ identifier: String) -> HKCategoryType?
    class func characteristicTypeForIdentifier(_ identifier: String) -> HKCharacteristicType?
    class func correlationTypeForIdentifier(_ identifier: String) -> HKCorrelationType?
    class func workoutType() -> HKWorkoutType
}
NSCopying, NSSecureCoding

Protocols
FromAnyObject
To--

Modified HKQuantity
DeclarationProtocols
From
class HKQuantity : NSObject, NSSecureCoding, NSCoding, NSCopying {
    init()
    convenience init(unit unit: HKUnit, doubleValue value: Double)
    class func quantityWithUnit(_ unit: HKUnit, doubleValue value: Double) -> Self
    func isCompatibleWithUnit(_ unit: HKUnit) -> Bool
    func doubleValueForUnit(_ unit: HKUnit) -> Double
    func compare(_ quantity: HKQuantity) -> NSComparisonResult
}
AnyObject, NSCoding, NSCopying, NSSecureCoding
To
class HKQuantity : NSObject, NSSecureCoding, NSCopying {
    init()
    convenience init(unit unit: HKUnit, doubleValue value: Double)
    class func quantityWithUnit(_ unit: HKUnit, doubleValue value: Double) -> Self
    func isCompatibleWithUnit(_ unit: HKUnit) -> Bool
    func doubleValueForUnit(_ unit: HKUnit) -> Double
    func compare(_ quantity: HKQuantity) -> NSComparisonResult
}
NSCopying, NSSecureCoding

Protocols
FromEquatable, Hashable, RawRepresentable
To--

Protocols
FromAnyObject
To--

Protocols
FromAnyObject
To--

Modified HKQuery
Protocols
FromAnyObject
To--

Modified HKQueryAnchor
DeclarationProtocols
From
class HKQueryAnchor : NSObject, NSSecureCoding, NSCoding, NSCopying {
    convenience init(fromValue value: Int)
    class func anchorFromValue(_ value: Int) -> Self
    init()
}
AnyObject, NSCoding, NSCopying, NSSecureCoding
To
class HKQueryAnchor : NSObject, NSSecureCoding, NSCopying {
    convenience init(fromValue value: Int)
    class func anchorFromValue(_ value: Int) -> Self
    init()
}
NSCopying, NSSecureCoding

Modified HKSample
Protocols
FromAnyObject
To--

Modified HKSampleQuery
Protocols
FromAnyObject
To--

Modified HKSampleType
Protocols
FromAnyObject
To--

Modified HKSource
DeclarationProtocols
From
class HKSource : NSObject, NSSecureCoding, NSCoding, NSCopying {
    var name: String { get }
    var bundleIdentifier: String { get }
    class func defaultSource() -> HKSource
    init()
}
AnyObject, NSCoding, NSCopying, NSSecureCoding
To
class HKSource : NSObject, NSSecureCoding, NSCopying {
    var name: String { get }
    var bundleIdentifier: String { get }
    class func defaultSource() -> HKSource
    init()
}
NSCopying, NSSecureCoding

Modified HKSourceQuery
Protocols
FromAnyObject
To--

DeclarationProtocols
From
class HKSourceRevision : NSObject, NSSecureCoding, NSCoding, NSCopying {
    var source: HKSource { get }
    var version: String? { get }
    init(source source: HKSource, version version: String)
    init()
}
AnyObject, NSCoding, NSCopying, NSSecureCoding
To
class HKSourceRevision : NSObject, NSSecureCoding, NSCopying {
    var source: HKSource { get }
    var version: String? { get }
    init(source source: HKSource, version version: String)
    init()
}
NSCopying, NSSecureCoding

Modified HKStatistics
DeclarationProtocols
From
class HKStatistics : NSObject, NSSecureCoding, NSCoding, NSCopying {
    var quantityType: HKQuantityType { get }
    var startDate: NSDate { get }
    var endDate: NSDate { get }
    var sources: [HKSource]? { get }
    init()
    func averageQuantityForSource(_ source: HKSource) -> HKQuantity?
    func averageQuantity() -> HKQuantity?
    func minimumQuantityForSource(_ source: HKSource) -> HKQuantity?
    func minimumQuantity() -> HKQuantity?
    func maximumQuantityForSource(_ source: HKSource) -> HKQuantity?
    func maximumQuantity() -> HKQuantity?
    func sumQuantityForSource(_ source: HKSource) -> HKQuantity?
    func sumQuantity() -> HKQuantity?
}
AnyObject, NSCoding, NSCopying, NSSecureCoding
To
class HKStatistics : NSObject, NSSecureCoding, NSCopying {
    var quantityType: HKQuantityType { get }
    var startDate: NSDate { get }
    var endDate: NSDate { get }
    var sources: [HKSource]? { get }
    init()
    func averageQuantityForSource(_ source: HKSource) -> HKQuantity?
    func averageQuantity() -> HKQuantity?
    func minimumQuantityForSource(_ source: HKSource) -> HKQuantity?
    func minimumQuantity() -> HKQuantity?
    func maximumQuantityForSource(_ source: HKSource) -> HKQuantity?
    func maximumQuantity() -> HKQuantity?
    func sumQuantityForSource(_ source: HKSource) -> HKQuantity?
    func sumQuantity() -> HKQuantity?
}
NSCopying, NSSecureCoding

Protocols
FromAnyObject
To--

Protocols
FromAnyObject
To--

Protocols
FromAnyObject
To--

Modified HKUnit
DeclarationProtocols
From
class HKUnit : NSObject, NSSecureCoding, NSCoding, NSCopying {
    var unitString: String { get }
    init()
    convenience init(fromString string: String)
    class func unitFromString(_ string: String) -> Self
    convenience init(fromMassFormatterUnit massFormatterUnit: NSMassFormatterUnit)
    class func unitFromMassFormatterUnit(_ massFormatterUnit: NSMassFormatterUnit) -> Self
    class func massFormatterUnitFromUnit(_ unit: HKUnit) -> NSMassFormatterUnit
    convenience init(fromLengthFormatterUnit lengthFormatterUnit: NSLengthFormatterUnit)
    class func unitFromLengthFormatterUnit(_ lengthFormatterUnit: NSLengthFormatterUnit) -> Self
    class func lengthFormatterUnitFromUnit(_ unit: HKUnit) -> NSLengthFormatterUnit
    convenience init(fromEnergyFormatterUnit energyFormatterUnit: NSEnergyFormatterUnit)
    class func unitFromEnergyFormatterUnit(_ energyFormatterUnit: NSEnergyFormatterUnit) -> Self
    class func energyFormatterUnitFromUnit(_ unit: HKUnit) -> NSEnergyFormatterUnit
    func isNull() -> Bool
}
extension HKUnit {
    class func gramUnitWithMetricPrefix(_ prefix: HKMetricPrefix) -> Self
    class func gramUnit() -> Self
    class func ounceUnit() -> Self
    class func poundUnit() -> Self
    class func stoneUnit() -> Self
    class func moleUnitWithMetricPrefix(_ prefix: HKMetricPrefix, molarMass gramsPerMole: Double) -> Self
    class func moleUnitWithMolarMass(_ gramsPerMole: Double) -> Self
}
extension HKUnit {
    class func meterUnitWithMetricPrefix(_ prefix: HKMetricPrefix) -> Self
    class func meterUnit() -> Self
    class func inchUnit() -> Self
    class func footUnit() -> Self
    class func yardUnit() -> Self
    class func mileUnit() -> Self
}
extension HKUnit {
    class func literUnitWithMetricPrefix(_ prefix: HKMetricPrefix) -> Self
    class func literUnit() -> Self
    class func fluidOunceUSUnit() -> Self
    class func fluidOunceImperialUnit() -> Self
    class func pintUSUnit() -> Self
    class func pintImperialUnit() -> Self
    class func cupUSUnit() -> Self
    class func cupImperialUnit() -> Self
}
extension HKUnit {
    class func pascalUnitWithMetricPrefix(_ prefix: HKMetricPrefix) -> Self
    class func pascalUnit() -> Self
    class func millimeterOfMercuryUnit() -> Self
    class func centimeterOfWaterUnit() -> Self
    class func atmosphereUnit() -> Self
}
extension HKUnit {
    class func secondUnitWithMetricPrefix(_ prefix: HKMetricPrefix) -> Self
    class func secondUnit() -> Self
    class func minuteUnit() -> Self
    class func hourUnit() -> Self
    class func dayUnit() -> Self
}
extension HKUnit {
    class func jouleUnitWithMetricPrefix(_ prefix: HKMetricPrefix) -> Self
    class func jouleUnit() -> Self
    class func calorieUnit() -> Self
    class func kilocalorieUnit() -> Self
}
extension HKUnit {
    class func degreeCelsiusUnit() -> Self
    class func degreeFahrenheitUnit() -> Self
    class func kelvinUnit() -> Self
}
extension HKUnit {
    class func siemenUnitWithMetricPrefix(_ prefix: HKMetricPrefix) -> Self
    class func siemenUnit() -> Self
}
extension HKUnit {
    class func countUnit() -> Self
    class func percentUnit() -> Self
}
extension HKUnit {
    func unitMultipliedByUnit(_ unit: HKUnit) -> HKUnit
    func unitDividedByUnit(_ unit: HKUnit) -> HKUnit
    func unitRaisedToPower(_ power: Int) -> HKUnit
    func reciprocalUnit() -> HKUnit
}
AnyObject, NSCoding, NSCopying, NSSecureCoding
To
class HKUnit : NSObject, NSSecureCoding, NSCopying {
    var unitString: String { get }
    init()
    convenience init(fromString string: String)
    class func unitFromString(_ string: String) -> Self
    convenience init(fromMassFormatterUnit massFormatterUnit: NSMassFormatterUnit)
    class func unitFromMassFormatterUnit(_ massFormatterUnit: NSMassFormatterUnit) -> Self
    class func massFormatterUnitFromUnit(_ unit: HKUnit) -> NSMassFormatterUnit
    convenience init(fromLengthFormatterUnit lengthFormatterUnit: NSLengthFormatterUnit)
    class func unitFromLengthFormatterUnit(_ lengthFormatterUnit: NSLengthFormatterUnit) -> Self
    class func lengthFormatterUnitFromUnit(_ unit: HKUnit) -> NSLengthFormatterUnit
    convenience init(fromEnergyFormatterUnit energyFormatterUnit: NSEnergyFormatterUnit)
    class func unitFromEnergyFormatterUnit(_ energyFormatterUnit: NSEnergyFormatterUnit) -> Self
    class func energyFormatterUnitFromUnit(_ unit: HKUnit) -> NSEnergyFormatterUnit
    func isNull() -> Bool
}
extension HKUnit {
    class func gramUnitWithMetricPrefix(_ prefix: HKMetricPrefix) -> Self
    class func gramUnit() -> Self
    class func ounceUnit() -> Self
    class func poundUnit() -> Self
    class func stoneUnit() -> Self
    class func moleUnitWithMetricPrefix(_ prefix: HKMetricPrefix, molarMass gramsPerMole: Double) -> Self
    class func moleUnitWithMolarMass(_ gramsPerMole: Double) -> Self
}
extension HKUnit {
    class func meterUnitWithMetricPrefix(_ prefix: HKMetricPrefix) -> Self
    class func meterUnit() -> Self
    class func inchUnit() -> Self
    class func footUnit() -> Self
    class func yardUnit() -> Self
    class func mileUnit() -> Self
}
extension HKUnit {
    class func literUnitWithMetricPrefix(_ prefix: HKMetricPrefix) -> Self
    class func literUnit() -> Self
    class func fluidOunceUSUnit() -> Self
    class func fluidOunceImperialUnit() -> Self
    class func pintUSUnit() -> Self
    class func pintImperialUnit() -> Self
    class func cupUSUnit() -> Self
    class func cupImperialUnit() -> Self
}
extension HKUnit {
    class func pascalUnitWithMetricPrefix(_ prefix: HKMetricPrefix) -> Self
    class func pascalUnit() -> Self
    class func millimeterOfMercuryUnit() -> Self
    class func centimeterOfWaterUnit() -> Self
    class func atmosphereUnit() -> Self
}
extension HKUnit {
    class func secondUnitWithMetricPrefix(_ prefix: HKMetricPrefix) -> Self
    class func secondUnit() -> Self
    class func minuteUnit() -> Self
    class func hourUnit() -> Self
    class func dayUnit() -> Self
}
extension HKUnit {
    class func jouleUnitWithMetricPrefix(_ prefix: HKMetricPrefix) -> Self
    class func jouleUnit() -> Self
    class func calorieUnit() -> Self
    class func kilocalorieUnit() -> Self
}
extension HKUnit {
    class func degreeCelsiusUnit() -> Self
    class func degreeFahrenheitUnit() -> Self
    class func kelvinUnit() -> Self
}
extension HKUnit {
    class func siemenUnitWithMetricPrefix(_ prefix: HKMetricPrefix) -> Self
    class func siemenUnit() -> Self
}
extension HKUnit {
    class func countUnit() -> Self
    class func percentUnit() -> Self
}
extension HKUnit {
    func unitMultipliedByUnit(_ unit: HKUnit) -> HKUnit
    func unitDividedByUnit(_ unit: HKUnit) -> HKUnit
    func unitRaisedToPower(_ power: Int) -> HKUnit
    func reciprocalUnit() -> HKUnit
}
NSCopying, NSSecureCoding

Protocols
FromEquatable, Hashable, RawRepresentable
To--

Modified HKWorkout
Protocols
FromAnyObject
To--

Protocols
FromEquatable, Hashable, RawRepresentable
To--

DeclarationProtocols
From
class HKWorkoutEvent : NSObject, NSSecureCoding, NSCoding {
    var type: HKWorkoutEventType { get }
    @NSCopying var date: NSDate { get }
    convenience init(type type: HKWorkoutEventType, date date: NSDate)
    class func workoutEventWithType(_ type: HKWorkoutEventType, date date: NSDate) -> Self
    init()
}
AnyObject, NSCoding, NSSecureCoding
To
class HKWorkoutEvent : NSObject, NSSecureCoding {
    var type: HKWorkoutEventType { get }
    @NSCopying var date: NSDate { get }
    convenience init(type type: HKWorkoutEventType, date date: NSDate)
    class func workoutEventWithType(_ type: HKWorkoutEventType, date date: NSDate) -> Self
    init()
}
NSSecureCoding

Protocols
FromEquatable, Hashable, RawRepresentable
To--

Modified HKWorkoutType
Protocols
FromAnyObject
To--