CoreBluetooth Changes for Swift
CoreBluetooth
Removed CBAttributePermissions.init(_: UInt)
Removed CBCentralManagerDelegate.centralManager(_: CBCentralManager!, didRetrieveConnectedPeripherals: [AnyObject]!)
Removed CBCentralManagerDelegate.centralManager(_: CBCentralManager!, didRetrievePeripherals: [AnyObject]!)
Removed CBCharacteristicProperties.init(_: UInt)
Removed CBMutableCharacteristic.UUID
Removed CBMutableService.isPrimary
Removed CBMutableService.UUID
Modified CBATTError [enum]
| Declaration | Protocols | Raw Value Type | |
|---|---|---|---|
| From | enum CBATTError : Int {
case Success
case InvalidHandle
case ReadNotPermitted
case WriteNotPermitted
case InvalidPdu
case InsufficientAuthentication
case RequestNotSupported
case InvalidOffset
case InsufficientAuthorization
case PrepareQueueFull
case AttributeNotFound
case AttributeNotLong
case InsufficientEncryptionKeySize
case InvalidAttributeValueLength
case UnlikelyError
case InsufficientEncryption
case UnsupportedGroupType
case InsufficientResources
} | Equatable, Hashable, RawRepresentable | -- |
| To | enum CBATTError : Int {
case Success
case InvalidHandle
case ReadNotPermitted
case WriteNotPermitted
case InvalidPdu
case InsufficientAuthentication
case RequestNotSupported
case InvalidOffset
case InsufficientAuthorization
case PrepareQueueFull
case AttributeNotFound
case AttributeNotLong
case InsufficientEncryptionKeySize
case InvalidAttributeValueLength
case UnlikelyError
case InsufficientEncryption
case UnsupportedGroupType
case InsufficientResources
}
extension CBATTError : Hashable, Equatable, __BridgedNSError, ErrorType, RawRepresentable, _ObjectiveCBridgeableErrorType, _BridgedNSError {
}
extension CBATTError : Hashable, Equatable, __BridgedNSError, ErrorType, RawRepresentable, _ObjectiveCBridgeableErrorType, _BridgedNSError {
} | Equatable, ErrorType, Hashable, RawRepresentable | Int |
Modified CBATTRequest
| Declaration | |
|---|---|
| From | class CBATTRequest : NSObject {
var central: CBCentral! { get }
var characteristic: CBCharacteristic! { get }
var offset: Int { get }
@NSCopying var value: NSData!
} |
| To | class CBATTRequest : NSObject {
init()
var central: CBCentral { get }
var characteristic: CBCharacteristic { get }
var offset: Int { get }
@NSCopying var value: NSData?
} |
Modified CBATTRequest.central
| Declaration | |
|---|---|
| From | var central: CBCentral! { get } |
| To | var central: CBCentral { get } |
Modified CBATTRequest.characteristic
| Declaration | |
|---|---|
| From | var characteristic: CBCharacteristic! { get } |
| To | var characteristic: CBCharacteristic { get } |
Modified CBATTRequest.value
| Declaration | |
|---|---|
| From | @NSCopying var value: NSData! |
| To | @NSCopying var value: NSData? |
Modified CBAttribute
| Declaration | |
|---|---|
| From | class CBAttribute : NSObject {
var UUID: CBUUID! { get }
} |
| To | class CBAttribute : NSObject {
init()
var UUID: CBUUID { get }
} |
Modified CBAttribute.UUID
| Declaration | |
|---|---|
| From | var UUID: CBUUID! { get } |
| To | var UUID: CBUUID { get } |
Modified CBAttributePermissions [struct]
| Declaration | Protocols | |
|---|---|---|
| From | struct CBAttributePermissions : RawOptionSetType {
init(_ rawValue: UInt)
init(rawValue rawValue: UInt)
static var Readable: CBAttributePermissions { get }
static var Writeable: CBAttributePermissions { get }
static var ReadEncryptionRequired: CBAttributePermissions { get }
static var WriteEncryptionRequired: CBAttributePermissions { get }
} | RawOptionSetType |
| To | struct CBAttributePermissions : OptionSetType {
init(rawValue rawValue: UInt)
static var Readable: CBAttributePermissions { get }
static var Writeable: CBAttributePermissions { get }
static var ReadEncryptionRequired: CBAttributePermissions { get }
static var WriteEncryptionRequired: CBAttributePermissions { get }
} | OptionSetType |
Modified CBCentralManager
| Declaration | |
|---|---|
| From | class CBCentralManager : NSObject {
weak var delegate: CBCentralManagerDelegate!
var state: CBCentralManagerState { get }
convenience init!(delegate delegate: CBCentralManagerDelegate!, queue queue: dispatch_queue_t!)
init!(delegate delegate: CBCentralManagerDelegate!, queue queue: dispatch_queue_t!, options options: [NSObject : AnyObject]!)
func retrievePeripherals(_ peripheralUUIDs: [AnyObject]!)
func retrievePeripheralsWithIdentifiers(_ identifiers: [AnyObject]!) -> [AnyObject]!
func retrieveConnectedPeripherals()
func retrieveConnectedPeripheralsWithServices(_ serviceUUIDs: [AnyObject]!) -> [AnyObject]!
func scanForPeripheralsWithServices(_ serviceUUIDs: [AnyObject]!, options options: [NSObject : AnyObject]!)
func stopScan()
func connectPeripheral(_ peripheral: CBPeripheral!, options options: [NSObject : AnyObject]!)
func cancelPeripheralConnection(_ peripheral: CBPeripheral!)
} |
| To | class CBCentralManager : NSObject {
unowned(unsafe) var delegate: CBCentralManagerDelegate?
var state: CBCentralManagerState { get }
var isScanning: Bool { get }
convenience init(delegate delegate: CBCentralManagerDelegate?, queue queue: dispatch_queue_t?)
init(delegate delegate: CBCentralManagerDelegate?, queue queue: dispatch_queue_t?, options options: [String : AnyObject]?)
func retrievePeripheralsWithIdentifiers(_ identifiers: [NSUUID]) -> [CBPeripheral]
func retrieveConnectedPeripheralsWithServices(_ serviceUUIDs: [CBUUID]) -> [CBPeripheral]
func scanForPeripheralsWithServices(_ serviceUUIDs: [CBUUID]?, options options: [String : AnyObject]?)
func stopScan()
func connectPeripheral(_ peripheral: CBPeripheral, options options: [String : AnyObject]?)
func cancelPeripheralConnection(_ peripheral: CBPeripheral)
} |
| Declaration | |
|---|---|
| From | func cancelPeripheralConnection(_ peripheral: CBPeripheral!) |
| To | func cancelPeripheralConnection(_ peripheral: CBPeripheral) |
| Declaration | |
|---|---|
| From | func connectPeripheral(_ peripheral: CBPeripheral!, options options: [NSObject : AnyObject]!) |
| To | func connectPeripheral(_ peripheral: CBPeripheral, options options: [String : AnyObject]?) |
Modified CBCentralManager.delegate
| Declaration | |
|---|---|
| From | weak var delegate: CBCentralManagerDelegate! |
| To | unowned(unsafe) var delegate: CBCentralManagerDelegate? |
| Declaration | |
|---|---|
| From | convenience init!(delegate delegate: CBCentralManagerDelegate!, queue queue: dispatch_queue_t!) |
| To | convenience init(delegate delegate: CBCentralManagerDelegate?, queue queue: dispatch_queue_t?) |
| Declaration | |
|---|---|
| From | init!(delegate delegate: CBCentralManagerDelegate!, queue queue: dispatch_queue_t!, options options: [NSObject : AnyObject]!) |
| To | init(delegate delegate: CBCentralManagerDelegate?, queue queue: dispatch_queue_t?, options options: [String : AnyObject]?) |
| Declaration | |
|---|---|
| From | func retrieveConnectedPeripheralsWithServices(_ serviceUUIDs: [AnyObject]!) -> [AnyObject]! |
| To | func retrieveConnectedPeripheralsWithServices(_ serviceUUIDs: [CBUUID]) -> [CBPeripheral] |
| Declaration | |
|---|---|
| From | func retrievePeripheralsWithIdentifiers(_ identifiers: [AnyObject]!) -> [AnyObject]! |
| To | func retrievePeripheralsWithIdentifiers(_ identifiers: [NSUUID]) -> [CBPeripheral] |
Modified CBCentralManager.scanForPeripheralsWithServices(_: [CBUUID]?, options: [String : AnyObject]?)
| Declaration | |
|---|---|
| From | func scanForPeripheralsWithServices(_ serviceUUIDs: [AnyObject]!, options options: [NSObject : AnyObject]!) |
| To | func scanForPeripheralsWithServices(_ serviceUUIDs: [CBUUID]?, options options: [String : AnyObject]?) |
Modified CBCentralManagerDelegate
| Declaration | |
|---|---|
| From | protocol CBCentralManagerDelegate : NSObjectProtocol {
func centralManagerDidUpdateState(_ central: CBCentralManager!)
optional func centralManager(_ central: CBCentralManager!, willRestoreState dict: [NSObject : AnyObject]!)
optional func centralManager(_ central: CBCentralManager!, didRetrievePeripherals peripherals: [AnyObject]!)
optional func centralManager(_ central: CBCentralManager!, didRetrieveConnectedPeripherals peripherals: [AnyObject]!)
optional func centralManager(_ central: CBCentralManager!, didDiscoverPeripheral peripheral: CBPeripheral!, advertisementData advertisementData: [NSObject : AnyObject]!, RSSI RSSI: NSNumber!)
optional func centralManager(_ central: CBCentralManager!, didConnectPeripheral peripheral: CBPeripheral!)
optional func centralManager(_ central: CBCentralManager!, didFailToConnectPeripheral peripheral: CBPeripheral!, error error: NSError!)
optional func centralManager(_ central: CBCentralManager!, didDisconnectPeripheral peripheral: CBPeripheral!, error error: NSError!)
} |
| To | protocol CBCentralManagerDelegate : NSObjectProtocol {
func centralManagerDidUpdateState(_ central: CBCentralManager)
optional func centralManager(_ central: CBCentralManager, willRestoreState dict: [String : AnyObject])
optional func centralManager(_ central: CBCentralManager, didDiscoverPeripheral peripheral: CBPeripheral, advertisementData advertisementData: [String : AnyObject], RSSI RSSI: NSNumber)
optional func centralManager(_ central: CBCentralManager, didConnectPeripheral peripheral: CBPeripheral)
optional func centralManager(_ central: CBCentralManager, didFailToConnectPeripheral peripheral: CBPeripheral, error error: NSError?)
optional func centralManager(_ central: CBCentralManager, didDisconnectPeripheral peripheral: CBPeripheral, error error: NSError?)
} |
Modified CBCentralManagerDelegate.centralManager(_: CBCentralManager, didConnectPeripheral: CBPeripheral)
| Declaration | Introduction | |
|---|---|---|
| From | optional func centralManager(_ central: CBCentralManager!, didConnectPeripheral peripheral: CBPeripheral!) | iOS 8.0 |
| To | optional func centralManager(_ central: CBCentralManager, didConnectPeripheral peripheral: CBPeripheral) | iOS 5.0 |
| Declaration | Introduction | |
|---|---|---|
| From | optional func centralManager(_ central: CBCentralManager!, didDisconnectPeripheral peripheral: CBPeripheral!, error error: NSError!) | iOS 8.0 |
| To | optional func centralManager(_ central: CBCentralManager, didDisconnectPeripheral peripheral: CBPeripheral, error error: NSError?) | iOS 5.0 |
| Declaration | Introduction | |
|---|---|---|
| From | optional func centralManager(_ central: CBCentralManager!, didDiscoverPeripheral peripheral: CBPeripheral!, advertisementData advertisementData: [NSObject : AnyObject]!, RSSI RSSI: NSNumber!) | iOS 8.0 |
| To | optional func centralManager(_ central: CBCentralManager, didDiscoverPeripheral peripheral: CBPeripheral, advertisementData advertisementData: [String : AnyObject], RSSI RSSI: NSNumber) | iOS 5.0 |
| Declaration | Introduction | |
|---|---|---|
| From | optional func centralManager(_ central: CBCentralManager!, didFailToConnectPeripheral peripheral: CBPeripheral!, error error: NSError!) | iOS 8.0 |
| To | optional func centralManager(_ central: CBCentralManager, didFailToConnectPeripheral peripheral: CBPeripheral, error error: NSError?) | iOS 5.0 |
Modified CBCentralManagerDelegate.centralManager(_: CBCentralManager, willRestoreState: [String : AnyObject])
| Declaration | Introduction | |
|---|---|---|
| From | optional func centralManager(_ central: CBCentralManager!, willRestoreState dict: [NSObject : AnyObject]!) | iOS 8.0 |
| To | optional func centralManager(_ central: CBCentralManager, willRestoreState dict: [String : AnyObject]) | iOS 5.0 |
| Declaration | Introduction | |
|---|---|---|
| From | func centralManagerDidUpdateState(_ central: CBCentralManager!) | iOS 8.0 |
| To | func centralManagerDidUpdateState(_ central: CBCentralManager) | iOS 5.0 |
Modified CBCentralManagerState [enum]
| Raw Value Type | |
|---|---|
| From | -- |
| To | Int |
Modified CBCharacteristic
| Declaration | |
|---|---|
| From | class CBCharacteristic : CBAttribute {
weak var service: CBService! { get }
var properties: CBCharacteristicProperties { get }
var value: NSData! { get }
var descriptors: [AnyObject]! { get }
var isBroadcasted: Bool { get }
var isNotifying: Bool { get }
} |
| To | class CBCharacteristic : CBAttribute {
unowned(unsafe) var service: CBService { get }
var properties: CBCharacteristicProperties { get }
var value: NSData? { get }
var descriptors: [CBDescriptor]? { get }
var isBroadcasted: Bool { get }
var isNotifying: Bool { get }
} |
Modified CBCharacteristic.descriptors
| Declaration | |
|---|---|
| From | var descriptors: [AnyObject]! { get } |
| To | var descriptors: [CBDescriptor]? { get } |
Modified CBCharacteristic.service
| Declaration | |
|---|---|
| From | weak var service: CBService! { get } |
| To | unowned(unsafe) var service: CBService { get } |
Modified CBCharacteristic.value
| Declaration | |
|---|---|
| From | var value: NSData! { get } |
| To | var value: NSData? { get } |
Modified CBCharacteristicProperties [struct]
| Declaration | Protocols | |
|---|---|---|
| From | struct CBCharacteristicProperties : RawOptionSetType {
init(_ rawValue: UInt)
init(rawValue rawValue: UInt)
static var Broadcast: CBCharacteristicProperties { get }
static var Read: CBCharacteristicProperties { get }
static var WriteWithoutResponse: CBCharacteristicProperties { get }
static var Write: CBCharacteristicProperties { get }
static var Notify: CBCharacteristicProperties { get }
static var Indicate: CBCharacteristicProperties { get }
static var AuthenticatedSignedWrites: CBCharacteristicProperties { get }
static var ExtendedProperties: CBCharacteristicProperties { get }
static var NotifyEncryptionRequired: CBCharacteristicProperties { get }
static var IndicateEncryptionRequired: CBCharacteristicProperties { get }
} | RawOptionSetType |
| To | struct CBCharacteristicProperties : OptionSetType {
init(rawValue rawValue: UInt)
static var Broadcast: CBCharacteristicProperties { get }
static var Read: CBCharacteristicProperties { get }
static var WriteWithoutResponse: CBCharacteristicProperties { get }
static var Write: CBCharacteristicProperties { get }
static var Notify: CBCharacteristicProperties { get }
static var Indicate: CBCharacteristicProperties { get }
static var AuthenticatedSignedWrites: CBCharacteristicProperties { get }
static var ExtendedProperties: CBCharacteristicProperties { get }
static var NotifyEncryptionRequired: CBCharacteristicProperties { get }
static var IndicateEncryptionRequired: CBCharacteristicProperties { get }
} | OptionSetType |
Modified CBCharacteristicWriteType [enum]
| Raw Value Type | |
|---|---|
| From | -- |
| To | Int |
Modified CBDescriptor
| Declaration | |
|---|---|
| From | class CBDescriptor : CBAttribute {
weak var characteristic: CBCharacteristic! { get }
var value: AnyObject! { get }
} |
| To | class CBDescriptor : CBAttribute {
unowned(unsafe) var characteristic: CBCharacteristic { get }
var value: AnyObject? { get }
} |
Modified CBDescriptor.characteristic
| Declaration | |
|---|---|
| From | weak var characteristic: CBCharacteristic! { get } |
| To | unowned(unsafe) var characteristic: CBCharacteristic { get } |
Modified CBDescriptor.value
| Declaration | |
|---|---|
| From | var value: AnyObject! { get } |
| To | var value: AnyObject? { get } |
Modified CBError [enum]
| Declaration | Protocols | Raw Value Type | |
|---|---|---|---|
| From | enum CBError : Int {
case Unknown
case InvalidParameters
case InvalidHandle
case NotConnected
case OutOfSpace
case OperationCancelled
case ConnectionTimeout
case PeripheralDisconnected
case UUIDNotAllowed
case AlreadyAdvertising
case ConnectionFailed
} | Equatable, Hashable, RawRepresentable | -- |
| To | enum CBError : Int {
case Unknown
case InvalidParameters
case InvalidHandle
case NotConnected
case OutOfSpace
case OperationCancelled
case ConnectionTimeout
case PeripheralDisconnected
case UUIDNotAllowed
case AlreadyAdvertising
case ConnectionFailed
case ConnectionLimitReached
}
extension CBError : Hashable, Equatable, __BridgedNSError, ErrorType, RawRepresentable, _ObjectiveCBridgeableErrorType, _BridgedNSError {
}
extension CBError : Hashable, Equatable, __BridgedNSError, ErrorType, RawRepresentable, _ObjectiveCBridgeableErrorType, _BridgedNSError {
} | Equatable, ErrorType, Hashable, RawRepresentable | Int |
Modified CBMutableCharacteristic
| Declaration | |
|---|---|
| From | class CBMutableCharacteristic : CBCharacteristic {
var permissions: CBAttributePermissions
var subscribedCentrals: [AnyObject]! { get }
var UUID: CBUUID!
var properties: CBCharacteristicProperties
var value: NSData!
var descriptors: [AnyObject]!
init!(type UUID: CBUUID!, properties properties: CBCharacteristicProperties, value value: NSData!, permissions permissions: CBAttributePermissions)
} |
| To | class CBMutableCharacteristic : CBCharacteristic {
var permissions: CBAttributePermissions
var subscribedCentrals: [CBCentral]? { get }
var properties: CBCharacteristicProperties
var value: NSData?
var descriptors: [CBDescriptor]?
init(type UUID: CBUUID, properties properties: CBCharacteristicProperties, value value: NSData?, permissions permissions: CBAttributePermissions)
} |
Modified CBMutableCharacteristic.descriptors
| Declaration | |
|---|---|
| From | var descriptors: [AnyObject]! |
| To | var descriptors: [CBDescriptor]? |
| Declaration | |
|---|---|
| From | init!(type UUID: CBUUID!, properties properties: CBCharacteristicProperties, value value: NSData!, permissions permissions: CBAttributePermissions) |
| To | init(type UUID: CBUUID, properties properties: CBCharacteristicProperties, value value: NSData?, permissions permissions: CBAttributePermissions) |
| Declaration | |
|---|---|
| From | var subscribedCentrals: [AnyObject]! { get } |
| To | var subscribedCentrals: [CBCentral]? { get } |
Modified CBMutableCharacteristic.value
| Declaration | |
|---|---|
| From | var value: NSData! |
| To | var value: NSData? |
Modified CBMutableDescriptor
| Declaration | |
|---|---|
| From | class CBMutableDescriptor : CBDescriptor {
init!(type UUID: CBUUID!, value value: AnyObject!)
} |
| To | class CBMutableDescriptor : CBDescriptor {
init(type UUID: CBUUID, value value: AnyObject?)
} |
| Declaration | |
|---|---|
| From | init!(type UUID: CBUUID!, value value: AnyObject!) |
| To | init(type UUID: CBUUID, value value: AnyObject?) |
Modified CBMutableService
| Declaration | |
|---|---|
| From | class CBMutableService : CBService {
var UUID: CBUUID!
var isPrimary: Bool
var includedServices: [AnyObject]!
var characteristics: [AnyObject]!
init!(type UUID: CBUUID!, primary isPrimary: Bool)
} |
| To | class CBMutableService : CBService {
var includedServices: [CBService]?
var characteristics: [CBCharacteristic]?
init(type UUID: CBUUID, primary isPrimary: Bool)
} |
Modified CBMutableService.characteristics
| Declaration | |
|---|---|
| From | var characteristics: [AnyObject]! |
| To | var characteristics: [CBCharacteristic]? |
Modified CBMutableService.includedServices
| Declaration | |
|---|---|
| From | var includedServices: [AnyObject]! |
| To | var includedServices: [CBService]? |
| Declaration | |
|---|---|
| From | init!(type UUID: CBUUID!, primary isPrimary: Bool) |
| To | init(type UUID: CBUUID, primary isPrimary: Bool) |
Modified CBPeer
| Declaration | |
|---|---|
| From | class CBPeer : NSObject, NSCopying {
var UUID: CFUUID! { get }
var identifier: NSUUID! { get }
} |
| To | class CBPeer : NSObject, NSCopying {
init()
var identifier: NSUUID { get }
} |
Modified CBPeer.identifier
| Declaration | |
|---|---|
| From | var identifier: NSUUID! { get } |
| To | var identifier: NSUUID { get } |
Modified CBPeripheral
| Declaration | |
|---|---|
| From | class CBPeripheral : CBPeer {
weak var delegate: CBPeripheralDelegate!
var name: String! { get }
var RSSI: NSNumber! { get }
var isConnected: Bool { get }
var state: CBPeripheralState { get }
var services: [AnyObject]! { get }
func readRSSI()
func discoverServices(_ serviceUUIDs: [AnyObject]!)
func discoverIncludedServices(_ includedServiceUUIDs: [AnyObject]!, forService service: CBService!)
func discoverCharacteristics(_ characteristicUUIDs: [AnyObject]!, forService service: CBService!)
func readValueForCharacteristic(_ characteristic: CBCharacteristic!)
func writeValue(_ data: NSData!, forCharacteristic characteristic: CBCharacteristic!, type type: CBCharacteristicWriteType)
func setNotifyValue(_ enabled: Bool, forCharacteristic characteristic: CBCharacteristic!)
func discoverDescriptorsForCharacteristic(_ characteristic: CBCharacteristic!)
func readValueForDescriptor(_ descriptor: CBDescriptor!)
func writeValue(_ data: NSData!, forDescriptor descriptor: CBDescriptor!)
} |
| To | class CBPeripheral : CBPeer {
unowned(unsafe) var delegate: CBPeripheralDelegate?
var name: String? { get }
var RSSI: NSNumber? { get }
var state: CBPeripheralState { get }
var services: [CBService]? { get }
func readRSSI()
func discoverServices(_ serviceUUIDs: [CBUUID]?)
func discoverIncludedServices(_ includedServiceUUIDs: [CBUUID]?, forService service: CBService)
func discoverCharacteristics(_ characteristicUUIDs: [CBUUID]?, forService service: CBService)
func readValueForCharacteristic(_ characteristic: CBCharacteristic)
func maximumWriteValueLengthForType(_ type: CBCharacteristicWriteType) -> Int
func writeValue(_ data: NSData, forCharacteristic characteristic: CBCharacteristic, type type: CBCharacteristicWriteType)
func setNotifyValue(_ enabled: Bool, forCharacteristic characteristic: CBCharacteristic)
func discoverDescriptorsForCharacteristic(_ characteristic: CBCharacteristic)
func readValueForDescriptor(_ descriptor: CBDescriptor)
func writeValue(_ data: NSData, forDescriptor descriptor: CBDescriptor)
} |
Modified CBPeripheral.delegate
| Declaration | |
|---|---|
| From | weak var delegate: CBPeripheralDelegate! |
| To | unowned(unsafe) var delegate: CBPeripheralDelegate? |
| Declaration | |
|---|---|
| From | func discoverCharacteristics(_ characteristicUUIDs: [AnyObject]!, forService service: CBService!) |
| To | func discoverCharacteristics(_ characteristicUUIDs: [CBUUID]?, forService service: CBService) |
| Declaration | |
|---|---|
| From | func discoverDescriptorsForCharacteristic(_ characteristic: CBCharacteristic!) |
| To | func discoverDescriptorsForCharacteristic(_ characteristic: CBCharacteristic) |
| Declaration | |
|---|---|
| From | func discoverIncludedServices(_ includedServiceUUIDs: [AnyObject]!, forService service: CBService!) |
| To | func discoverIncludedServices(_ includedServiceUUIDs: [CBUUID]?, forService service: CBService) |
| Declaration | |
|---|---|
| From | func discoverServices(_ serviceUUIDs: [AnyObject]!) |
| To | func discoverServices(_ serviceUUIDs: [CBUUID]?) |
Modified CBPeripheral.name
| Declaration | |
|---|---|
| From | var name: String! { get } |
| To | var name: String? { get } |
| Declaration | |
|---|---|
| From | func readValueForCharacteristic(_ characteristic: CBCharacteristic!) |
| To | func readValueForCharacteristic(_ characteristic: CBCharacteristic) |
| Declaration | |
|---|---|
| From | func readValueForDescriptor(_ descriptor: CBDescriptor!) |
| To | func readValueForDescriptor(_ descriptor: CBDescriptor) |
Modified CBPeripheral.RSSI
| Declaration | |
|---|---|
| From | var RSSI: NSNumber! { get } |
| To | var RSSI: NSNumber? { get } |
Modified CBPeripheral.services
| Declaration | |
|---|---|
| From | var services: [AnyObject]! { get } |
| To | var services: [CBService]? { get } |
| Declaration | |
|---|---|
| From | func setNotifyValue(_ enabled: Bool, forCharacteristic characteristic: CBCharacteristic!) |
| To | func setNotifyValue(_ enabled: Bool, forCharacteristic characteristic: CBCharacteristic) |
| Declaration | |
|---|---|
| From | func writeValue(_ data: NSData!, forCharacteristic characteristic: CBCharacteristic!, type type: CBCharacteristicWriteType) |
| To | func writeValue(_ data: NSData, forCharacteristic characteristic: CBCharacteristic, type type: CBCharacteristicWriteType) |
| Declaration | |
|---|---|
| From | func writeValue(_ data: NSData!, forDescriptor descriptor: CBDescriptor!) |
| To | func writeValue(_ data: NSData, forDescriptor descriptor: CBDescriptor) |
Modified CBPeripheralDelegate
| Declaration | |
|---|---|
| From | protocol CBPeripheralDelegate : NSObjectProtocol {
optional func peripheralDidUpdateName(_ peripheral: CBPeripheral!)
optional func peripheralDidInvalidateServices(_ peripheral: CBPeripheral!)
optional func peripheral(_ peripheral: CBPeripheral!, didModifyServices invalidatedServices: [AnyObject]!)
optional func peripheralDidUpdateRSSI(_ peripheral: CBPeripheral!, error error: NSError!)
optional func peripheral(_ peripheral: CBPeripheral!, didReadRSSI RSSI: NSNumber!, error error: NSError!)
optional func peripheral(_ peripheral: CBPeripheral!, didDiscoverServices error: NSError!)
optional func peripheral(_ peripheral: CBPeripheral!, didDiscoverIncludedServicesForService service: CBService!, error error: NSError!)
optional func peripheral(_ peripheral: CBPeripheral!, didDiscoverCharacteristicsForService service: CBService!, error error: NSError!)
optional func peripheral(_ peripheral: CBPeripheral!, didUpdateValueForCharacteristic characteristic: CBCharacteristic!, error error: NSError!)
optional func peripheral(_ peripheral: CBPeripheral!, didWriteValueForCharacteristic characteristic: CBCharacteristic!, error error: NSError!)
optional func peripheral(_ peripheral: CBPeripheral!, didUpdateNotificationStateForCharacteristic characteristic: CBCharacteristic!, error error: NSError!)
optional func peripheral(_ peripheral: CBPeripheral!, didDiscoverDescriptorsForCharacteristic characteristic: CBCharacteristic!, error error: NSError!)
optional func peripheral(_ peripheral: CBPeripheral!, didUpdateValueForDescriptor descriptor: CBDescriptor!, error error: NSError!)
optional func peripheral(_ peripheral: CBPeripheral!, didWriteValueForDescriptor descriptor: CBDescriptor!, error error: NSError!)
} |
| To | protocol CBPeripheralDelegate : NSObjectProtocol {
optional func peripheralDidUpdateName(_ peripheral: CBPeripheral)
optional func peripheral(_ peripheral: CBPeripheral, didModifyServices invalidatedServices: [CBService])
optional func peripheralDidUpdateRSSI(_ peripheral: CBPeripheral, error error: NSError?)
optional func peripheral(_ peripheral: CBPeripheral, didReadRSSI RSSI: NSNumber, error error: NSError?)
optional func peripheral(_ peripheral: CBPeripheral, didDiscoverServices error: NSError?)
optional func peripheral(_ peripheral: CBPeripheral, didDiscoverIncludedServicesForService service: CBService, error error: NSError?)
optional func peripheral(_ peripheral: CBPeripheral, didDiscoverCharacteristicsForService service: CBService, error error: NSError?)
optional func peripheral(_ peripheral: CBPeripheral, didUpdateValueForCharacteristic characteristic: CBCharacteristic, error error: NSError?)
optional func peripheral(_ peripheral: CBPeripheral, didWriteValueForCharacteristic characteristic: CBCharacteristic, error error: NSError?)
optional func peripheral(_ peripheral: CBPeripheral, didUpdateNotificationStateForCharacteristic characteristic: CBCharacteristic, error error: NSError?)
optional func peripheral(_ peripheral: CBPeripheral, didDiscoverDescriptorsForCharacteristic characteristic: CBCharacteristic, error error: NSError?)
optional func peripheral(_ peripheral: CBPeripheral, didUpdateValueForDescriptor descriptor: CBDescriptor, error error: NSError?)
optional func peripheral(_ peripheral: CBPeripheral, didWriteValueForDescriptor descriptor: CBDescriptor, error error: NSError?)
} |
| Declaration | Introduction | |
|---|---|---|
| From | optional func peripheral(_ peripheral: CBPeripheral!, didDiscoverCharacteristicsForService service: CBService!, error error: NSError!) | iOS 8.0 |
| To | optional func peripheral(_ peripheral: CBPeripheral, didDiscoverCharacteristicsForService service: CBService, error error: NSError?) | iOS 5.0 |
| Declaration | Introduction | |
|---|---|---|
| From | optional func peripheral(_ peripheral: CBPeripheral!, didDiscoverDescriptorsForCharacteristic characteristic: CBCharacteristic!, error error: NSError!) | iOS 8.0 |
| To | optional func peripheral(_ peripheral: CBPeripheral, didDiscoverDescriptorsForCharacteristic characteristic: CBCharacteristic, error error: NSError?) | iOS 5.0 |
| Declaration | Introduction | |
|---|---|---|
| From | optional func peripheral(_ peripheral: CBPeripheral!, didDiscoverIncludedServicesForService service: CBService!, error error: NSError!) | iOS 8.0 |
| To | optional func peripheral(_ peripheral: CBPeripheral, didDiscoverIncludedServicesForService service: CBService, error error: NSError?) | iOS 5.0 |
| Declaration | Introduction | |
|---|---|---|
| From | optional func peripheral(_ peripheral: CBPeripheral!, didDiscoverServices error: NSError!) | iOS 8.0 |
| To | optional func peripheral(_ peripheral: CBPeripheral, didDiscoverServices error: NSError?) | iOS 5.0 |
| Declaration | |
|---|---|
| From | optional func peripheral(_ peripheral: CBPeripheral!, didModifyServices invalidatedServices: [AnyObject]!) |
| To | optional func peripheral(_ peripheral: CBPeripheral, didModifyServices invalidatedServices: [CBService]) |
| Declaration | |
|---|---|
| From | optional func peripheral(_ peripheral: CBPeripheral!, didReadRSSI RSSI: NSNumber!, error error: NSError!) |
| To | optional func peripheral(_ peripheral: CBPeripheral, didReadRSSI RSSI: NSNumber, error error: NSError?) |
| Declaration | Introduction | |
|---|---|---|
| From | optional func peripheral(_ peripheral: CBPeripheral!, didUpdateNotificationStateForCharacteristic characteristic: CBCharacteristic!, error error: NSError!) | iOS 8.0 |
| To | optional func peripheral(_ peripheral: CBPeripheral, didUpdateNotificationStateForCharacteristic characteristic: CBCharacteristic, error error: NSError?) | iOS 5.0 |
| Declaration | Introduction | |
|---|---|---|
| From | optional func peripheral(_ peripheral: CBPeripheral!, didUpdateValueForCharacteristic characteristic: CBCharacteristic!, error error: NSError!) | iOS 8.0 |
| To | optional func peripheral(_ peripheral: CBPeripheral, didUpdateValueForCharacteristic characteristic: CBCharacteristic, error error: NSError?) | iOS 5.0 |
| Declaration | Introduction | |
|---|---|---|
| From | optional func peripheral(_ peripheral: CBPeripheral!, didUpdateValueForDescriptor descriptor: CBDescriptor!, error error: NSError!) | iOS 8.0 |
| To | optional func peripheral(_ peripheral: CBPeripheral, didUpdateValueForDescriptor descriptor: CBDescriptor, error error: NSError?) | iOS 5.0 |
| Declaration | Introduction | |
|---|---|---|
| From | optional func peripheral(_ peripheral: CBPeripheral!, didWriteValueForCharacteristic characteristic: CBCharacteristic!, error error: NSError!) | iOS 8.0 |
| To | optional func peripheral(_ peripheral: CBPeripheral, didWriteValueForCharacteristic characteristic: CBCharacteristic, error error: NSError?) | iOS 5.0 |
| Declaration | Introduction | |
|---|---|---|
| From | optional func peripheral(_ peripheral: CBPeripheral!, didWriteValueForDescriptor descriptor: CBDescriptor!, error error: NSError!) | iOS 8.0 |
| To | optional func peripheral(_ peripheral: CBPeripheral, didWriteValueForDescriptor descriptor: CBDescriptor, error error: NSError?) | iOS 5.0 |
| Declaration | |
|---|---|
| From | optional func peripheralDidUpdateName(_ peripheral: CBPeripheral!) |
| To | optional func peripheralDidUpdateName(_ peripheral: CBPeripheral) |
| Declaration | |
|---|---|
| From | optional func peripheralDidUpdateRSSI(_ peripheral: CBPeripheral!, error error: NSError!) |
| To | optional func peripheralDidUpdateRSSI(_ peripheral: CBPeripheral, error error: NSError?) |
Modified CBPeripheralManager
| Declaration | |
|---|---|
| From | class CBPeripheralManager : NSObject {
weak var delegate: CBPeripheralManagerDelegate!
var state: CBPeripheralManagerState { get }
var isAdvertising: Bool { get }
class func authorizationStatus() -> CBPeripheralManagerAuthorizationStatus
convenience init!(delegate delegate: CBPeripheralManagerDelegate!, queue queue: dispatch_queue_t!)
init!(delegate delegate: CBPeripheralManagerDelegate!, queue queue: dispatch_queue_t!, options options: [NSObject : AnyObject]!)
func startAdvertising(_ advertisementData: [NSObject : AnyObject]!)
func stopAdvertising()
func setDesiredConnectionLatency(_ latency: CBPeripheralManagerConnectionLatency, forCentral central: CBCentral!)
func addService(_ service: CBMutableService!)
func removeService(_ service: CBMutableService!)
func removeAllServices()
func respondToRequest(_ request: CBATTRequest!, withResult result: CBATTError)
func updateValue(_ value: NSData!, forCharacteristic characteristic: CBMutableCharacteristic!, onSubscribedCentrals centrals: [AnyObject]!) -> Bool
} |
| To | class CBPeripheralManager : NSObject {
unowned(unsafe) var delegate: CBPeripheralManagerDelegate?
var state: CBPeripheralManagerState { get }
var isAdvertising: Bool { get }
class func authorizationStatus() -> CBPeripheralManagerAuthorizationStatus
convenience init(delegate delegate: CBPeripheralManagerDelegate?, queue queue: dispatch_queue_t?)
init(delegate delegate: CBPeripheralManagerDelegate?, queue queue: dispatch_queue_t?, options options: [String : AnyObject]?)
func startAdvertising(_ advertisementData: [String : AnyObject]?)
func stopAdvertising()
func setDesiredConnectionLatency(_ latency: CBPeripheralManagerConnectionLatency, forCentral central: CBCentral)
func addService(_ service: CBMutableService)
func removeService(_ service: CBMutableService)
func removeAllServices()
func respondToRequest(_ request: CBATTRequest, withResult result: CBATTError)
func updateValue(_ value: NSData, forCharacteristic characteristic: CBMutableCharacteristic, onSubscribedCentrals centrals: [CBCentral]?) -> Bool
} |
| Declaration | |
|---|---|
| From | func addService(_ service: CBMutableService!) |
| To | func addService(_ service: CBMutableService) |
Modified CBPeripheralManager.delegate
| Declaration | |
|---|---|
| From | weak var delegate: CBPeripheralManagerDelegate! |
| To | unowned(unsafe) var delegate: CBPeripheralManagerDelegate? |
| Declaration | |
|---|---|
| From | convenience init!(delegate delegate: CBPeripheralManagerDelegate!, queue queue: dispatch_queue_t!) |
| To | convenience init(delegate delegate: CBPeripheralManagerDelegate?, queue queue: dispatch_queue_t?) |
| Declaration | |
|---|---|
| From | init!(delegate delegate: CBPeripheralManagerDelegate!, queue queue: dispatch_queue_t!, options options: [NSObject : AnyObject]!) |
| To | init(delegate delegate: CBPeripheralManagerDelegate?, queue queue: dispatch_queue_t?, options options: [String : AnyObject]?) |
| Declaration | |
|---|---|
| From | func removeService(_ service: CBMutableService!) |
| To | func removeService(_ service: CBMutableService) |
| Declaration | |
|---|---|
| From | func respondToRequest(_ request: CBATTRequest!, withResult result: CBATTError) |
| To | func respondToRequest(_ request: CBATTRequest, withResult result: CBATTError) |
| Declaration | |
|---|---|
| From | func setDesiredConnectionLatency(_ latency: CBPeripheralManagerConnectionLatency, forCentral central: CBCentral!) |
| To | func setDesiredConnectionLatency(_ latency: CBPeripheralManagerConnectionLatency, forCentral central: CBCentral) |
| Declaration | |
|---|---|
| From | func startAdvertising(_ advertisementData: [NSObject : AnyObject]!) |
| To | func startAdvertising(_ advertisementData: [String : AnyObject]?) |
| Declaration | |
|---|---|
| From | func updateValue(_ value: NSData!, forCharacteristic characteristic: CBMutableCharacteristic!, onSubscribedCentrals centrals: [AnyObject]!) -> Bool |
| To | func updateValue(_ value: NSData, forCharacteristic characteristic: CBMutableCharacteristic, onSubscribedCentrals centrals: [CBCentral]?) -> Bool |
| Raw Value Type | |
|---|---|
| From | -- |
| To | Int |
| Raw Value Type | |
|---|---|
| From | -- |
| To | Int |
Modified CBPeripheralManagerDelegate
| Declaration | |
|---|---|
| From | protocol CBPeripheralManagerDelegate : NSObjectProtocol {
func peripheralManagerDidUpdateState(_ peripheral: CBPeripheralManager!)
optional func peripheralManager(_ peripheral: CBPeripheralManager!, willRestoreState dict: [NSObject : AnyObject]!)
optional func peripheralManagerDidStartAdvertising(_ peripheral: CBPeripheralManager!, error error: NSError!)
optional func peripheralManager(_ peripheral: CBPeripheralManager!, didAddService service: CBService!, error error: NSError!)
optional func peripheralManager(_ peripheral: CBPeripheralManager!, central central: CBCentral!, didSubscribeToCharacteristic characteristic: CBCharacteristic!)
optional func peripheralManager(_ peripheral: CBPeripheralManager!, central central: CBCentral!, didUnsubscribeFromCharacteristic characteristic: CBCharacteristic!)
optional func peripheralManager(_ peripheral: CBPeripheralManager!, didReceiveReadRequest request: CBATTRequest!)
optional func peripheralManager(_ peripheral: CBPeripheralManager!, didReceiveWriteRequests requests: [AnyObject]!)
optional func peripheralManagerIsReadyToUpdateSubscribers(_ peripheral: CBPeripheralManager!)
} |
| To | protocol CBPeripheralManagerDelegate : NSObjectProtocol {
func peripheralManagerDidUpdateState(_ peripheral: CBPeripheralManager)
optional func peripheralManager(_ peripheral: CBPeripheralManager, willRestoreState dict: [String : AnyObject])
optional func peripheralManagerDidStartAdvertising(_ peripheral: CBPeripheralManager, error error: NSError?)
optional func peripheralManager(_ peripheral: CBPeripheralManager, didAddService service: CBService, error error: NSError?)
optional func peripheralManager(_ peripheral: CBPeripheralManager, central central: CBCentral, didSubscribeToCharacteristic characteristic: CBCharacteristic)
optional func peripheralManager(_ peripheral: CBPeripheralManager, central central: CBCentral, didUnsubscribeFromCharacteristic characteristic: CBCharacteristic)
optional func peripheralManager(_ peripheral: CBPeripheralManager, didReceiveReadRequest request: CBATTRequest)
optional func peripheralManager(_ peripheral: CBPeripheralManager, didReceiveWriteRequests requests: [CBATTRequest])
optional func peripheralManagerIsReadyToUpdateSubscribers(_ peripheral: CBPeripheralManager)
} |
| Declaration | Introduction | |
|---|---|---|
| From | optional func peripheralManager(_ peripheral: CBPeripheralManager!, central central: CBCentral!, didSubscribeToCharacteristic characteristic: CBCharacteristic!) | iOS 8.0 |
| To | optional func peripheralManager(_ peripheral: CBPeripheralManager, central central: CBCentral, didSubscribeToCharacteristic characteristic: CBCharacteristic) | iOS 6.0 |
| Declaration | Introduction | |
|---|---|---|
| From | optional func peripheralManager(_ peripheral: CBPeripheralManager!, central central: CBCentral!, didUnsubscribeFromCharacteristic characteristic: CBCharacteristic!) | iOS 8.0 |
| To | optional func peripheralManager(_ peripheral: CBPeripheralManager, central central: CBCentral, didUnsubscribeFromCharacteristic characteristic: CBCharacteristic) | iOS 6.0 |
| Declaration | Introduction | |
|---|---|---|
| From | optional func peripheralManager(_ peripheral: CBPeripheralManager!, didAddService service: CBService!, error error: NSError!) | iOS 8.0 |
| To | optional func peripheralManager(_ peripheral: CBPeripheralManager, didAddService service: CBService, error error: NSError?) | iOS 6.0 |
| Declaration | Introduction | |
|---|---|---|
| From | optional func peripheralManager(_ peripheral: CBPeripheralManager!, didReceiveReadRequest request: CBATTRequest!) | iOS 8.0 |
| To | optional func peripheralManager(_ peripheral: CBPeripheralManager, didReceiveReadRequest request: CBATTRequest) | iOS 6.0 |
| Declaration | Introduction | |
|---|---|---|
| From | optional func peripheralManager(_ peripheral: CBPeripheralManager!, didReceiveWriteRequests requests: [AnyObject]!) | iOS 8.0 |
| To | optional func peripheralManager(_ peripheral: CBPeripheralManager, didReceiveWriteRequests requests: [CBATTRequest]) | iOS 6.0 |
| Declaration | Introduction | |
|---|---|---|
| From | optional func peripheralManager(_ peripheral: CBPeripheralManager!, willRestoreState dict: [NSObject : AnyObject]!) | iOS 8.0 |
| To | optional func peripheralManager(_ peripheral: CBPeripheralManager, willRestoreState dict: [String : AnyObject]) | iOS 6.0 |
| Declaration | Introduction | |
|---|---|---|
| From | optional func peripheralManagerDidStartAdvertising(_ peripheral: CBPeripheralManager!, error error: NSError!) | iOS 8.0 |
| To | optional func peripheralManagerDidStartAdvertising(_ peripheral: CBPeripheralManager, error error: NSError?) | iOS 6.0 |
| Declaration | Introduction | |
|---|---|---|
| From | func peripheralManagerDidUpdateState(_ peripheral: CBPeripheralManager!) | iOS 8.0 |
| To | func peripheralManagerDidUpdateState(_ peripheral: CBPeripheralManager) | iOS 6.0 |
Modified CBPeripheralManagerDelegate.peripheralManagerIsReadyToUpdateSubscribers(_: CBPeripheralManager)
| Declaration | Introduction | |
|---|---|---|
| From | optional func peripheralManagerIsReadyToUpdateSubscribers(_ peripheral: CBPeripheralManager!) | iOS 8.0 |
| To | optional func peripheralManagerIsReadyToUpdateSubscribers(_ peripheral: CBPeripheralManager) | iOS 6.0 |
Modified CBPeripheralManagerState [enum]
| Raw Value Type | |
|---|---|
| From | -- |
| To | Int |
Modified CBPeripheralState [enum]
| Declaration | Raw Value Type | |
|---|---|---|
| From | enum CBPeripheralState : Int {
case Disconnected
case Connecting
case Connected
} | -- |
| To | enum CBPeripheralState : Int {
case Disconnected
case Connecting
case Connected
case Disconnecting
} | Int |
Modified CBService
| Declaration | |
|---|---|
| From | class CBService : CBAttribute {
weak var peripheral: CBPeripheral! { get }
var isPrimary: Bool { get }
var includedServices: [AnyObject]! { get }
var characteristics: [AnyObject]! { get }
} |
| To | class CBService : CBAttribute {
unowned(unsafe) var peripheral: CBPeripheral { get }
var isPrimary: Bool { get }
var includedServices: [CBService]? { get }
var characteristics: [CBCharacteristic]? { get }
} |
Modified CBService.characteristics
| Declaration | |
|---|---|
| From | var characteristics: [AnyObject]! { get } |
| To | var characteristics: [CBCharacteristic]? { get } |
Modified CBService.includedServices
| Declaration | |
|---|---|
| From | var includedServices: [AnyObject]! { get } |
| To | var includedServices: [CBService]? { get } |
Modified CBService.peripheral
| Declaration | |
|---|---|
| From | weak var peripheral: CBPeripheral! { get } |
| To | unowned(unsafe) var peripheral: CBPeripheral { get } |
Modified CBUUID
| Declaration | |
|---|---|
| From | class CBUUID : NSObject, NSCopying {
var data: NSData! { get }
var UUIDString: String! { get }
init!(string theString: String!) -> CBUUID
class func UUIDWithString(_ theString: String!) -> CBUUID!
init!(data theData: NSData!) -> CBUUID
class func UUIDWithData(_ theData: NSData!) -> CBUUID!
init!(CFUUID theUUID: CFUUID!) -> CBUUID
class func UUIDWithCFUUID(_ theUUID: CFUUID!) -> CBUUID!
init!(NSUUID theUUID: NSUUID!) -> CBUUID
class func UUIDWithNSUUID(_ theUUID: NSUUID!) -> CBUUID!
} |
| To | class CBUUID : NSObject, NSCopying {
var data: NSData { get }
var UUIDString: String { get }
init(string theString: String)
class func UUIDWithString(_ theString: String) -> CBUUID
init(data theData: NSData)
class func UUIDWithData(_ theData: NSData) -> CBUUID
init(CFUUID theUUID: CFUUID)
class func UUIDWithCFUUID(_ theUUID: CFUUID) -> CBUUID
init(NSUUID theUUID: NSUUID)
class func UUIDWithNSUUID(_ theUUID: NSUUID) -> CBUUID
} |
Modified CBUUID.data
| Declaration | |
|---|---|
| From | var data: NSData! { get } |
| To | var data: NSData { get } |
Modified CBUUID.init(CFUUID: CFUUID)
| Declaration | Introduction | Deprecation | |
|---|---|---|---|
| From | init!(CFUUID theUUID: CFUUID!) -> CBUUID | iOS 8.1 | -- |
| To | init(CFUUID theUUID: CFUUID) | iOS 5.0 | iOS 9.0 |
Modified CBUUID.init(data: NSData)
| Declaration | |
|---|---|
| From | init!(data theData: NSData!) -> CBUUID |
| To | init(data theData: NSData) |
Modified CBUUID.init(NSUUID: NSUUID)
| Declaration | |
|---|---|
| From | init!(NSUUID theUUID: NSUUID!) -> CBUUID |
| To | init(NSUUID theUUID: NSUUID) |
Modified CBUUID.init(string: String)
| Declaration | |
|---|---|
| From | init!(string theString: String!) -> CBUUID |
| To | init(string theString: String) |
Modified CBUUID.UUIDString
| Declaration | |
|---|---|
| From | var UUIDString: String! { get } |
| To | var UUIDString: String { get } |