Documentation Archive Developer
Search

CoreBluetooth Changes for Swift

CoreBluetooth

Removed CBAttributePermissions.init(_: Int)
Removed CBCharacteristicProperties.init(_: Int)
Added CBError.MaxConnection
Added CBUUIDValidRangeString
DeclarationProtocolsRaw 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, RawRepresentableInt

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 {
    var central: CBCentral { get }
    var characteristic: CBCharacteristic { get }
    var offset: Int { get }
    @NSCopying var value: NSData?
}

Declaration
From
var central: CBCentral! { get }
To
var central: CBCentral { get }

Declaration
From
var characteristic: CBCharacteristic! { get }
To
var characteristic: CBCharacteristic { get }

Declaration
From
@NSCopying var value: NSData!
To
@NSCopying var value: NSData?

DeclarationProtocols
From
struct CBAttributePermissions : RawOptionSetType {
    init(_ rawValue: Int)
    init(rawValue rawValue: Int)
    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: Int)
    static var Readable: CBAttributePermissions { get }
    static var Writeable: CBAttributePermissions { get }
    static var ReadEncryptionRequired: CBAttributePermissions { get }
    static var WriteEncryptionRequired: CBAttributePermissions { get }
}
OptionSetType

Modified CBCentral
Declaration
From
class CBCentral : NSObject, NSCopying {
    var UUID: CFUUID! { get }
    var identifier: NSUUID! { get }
    var maximumUpdateValueLength: Int { get }
}
To
class CBCentral : NSObject, NSCopying {
    var UUID: CFUUID { get }
    var identifier: NSUUID { get }
    var maximumUpdateValueLength: Int { get }
}

Modified CBCentral.identifier
Declaration
From
var identifier: NSUUID! { get }
To
var identifier: NSUUID { get }

Declaration
From
class CBCentralManager : NSObject {
    unowned(unsafe) var delegate: CBCentralManagerDelegate!
    var state: CBCentralManagerState { get }
    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 }
    init(delegate delegate: CBCentralManagerDelegate?, queue queue: dispatch_queue_t?)
    init(delegate delegate: CBCentralManagerDelegate?, queue queue: dispatch_queue_t?, options options: [String : AnyObject]?)
    func retrievePeripherals(_ peripheralUUIDs: [AnyObject])
    func retrievePeripheralsWithIdentifiers(_ identifiers: [NSUUID]) -> [CBPeripheral]
    func retrieveConnectedPeripherals()
    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]?)

Declaration
From
unowned(unsafe) var delegate: CBCentralManagerDelegate!
To
unowned(unsafe) var delegate: CBCentralManagerDelegate?

Declaration
From
init!(delegate delegate: CBCentralManagerDelegate!, queue queue: dispatch_queue_t!)
To
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]

Declaration
From
func scanForPeripheralsWithServices(_ serviceUUIDs: [AnyObject]!, options options: [NSObject : AnyObject]!)
To
func scanForPeripheralsWithServices(_ serviceUUIDs: [CBUUID]?, options options: [String : AnyObject]?)

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, didRetrievePeripherals peripherals: [CBPeripheral])
    optional func centralManager(_ central: CBCentralManager, didRetrieveConnectedPeripherals peripherals: [CBPeripheral])
    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?)
}

DeclarationIntroduction
From
optional func centralManager(_ central: CBCentralManager!, didConnectPeripheral peripheral: CBPeripheral!)
OS X 10.10
To
optional func centralManager(_ central: CBCentralManager, didConnectPeripheral peripheral: CBPeripheral)
OS X 10.7

DeclarationIntroduction
From
optional func centralManager(_ central: CBCentralManager!, didDisconnectPeripheral peripheral: CBPeripheral!, error error: NSError!)
OS X 10.10
To
optional func centralManager(_ central: CBCentralManager, didDisconnectPeripheral peripheral: CBPeripheral, error error: NSError?)
OS X 10.7

DeclarationIntroduction
From
optional func centralManager(_ central: CBCentralManager!, didDiscoverPeripheral peripheral: CBPeripheral!, advertisementData advertisementData: [NSObject : AnyObject]!, RSSI RSSI: NSNumber!)
OS X 10.10
To
optional func centralManager(_ central: CBCentralManager, didDiscoverPeripheral peripheral: CBPeripheral, advertisementData advertisementData: [String : AnyObject], RSSI RSSI: NSNumber)
OS X 10.7

DeclarationIntroduction
From
optional func centralManager(_ central: CBCentralManager!, didFailToConnectPeripheral peripheral: CBPeripheral!, error error: NSError!)
OS X 10.10
To
optional func centralManager(_ central: CBCentralManager, didFailToConnectPeripheral peripheral: CBPeripheral, error error: NSError?)
OS X 10.7

Modified CBCentralManagerDelegate.centralManager(_: CBCentralManager, didRetrieveConnectedPeripherals: [CBPeripheral])
DeclarationIntroduction
From
optional func centralManager(_ central: CBCentralManager!, didRetrieveConnectedPeripherals peripherals: [AnyObject]!)
OS X 10.10
To
optional func centralManager(_ central: CBCentralManager, didRetrieveConnectedPeripherals peripherals: [CBPeripheral])
OS X 10.7

Modified CBCentralManagerDelegate.centralManager(_: CBCentralManager, didRetrievePeripherals: [CBPeripheral])
DeclarationIntroduction
From
optional func centralManager(_ central: CBCentralManager!, didRetrievePeripherals peripherals: [AnyObject]!)
OS X 10.10
To
optional func centralManager(_ central: CBCentralManager, didRetrievePeripherals peripherals: [CBPeripheral])
OS X 10.7

DeclarationIntroduction
From
optional func centralManager(_ central: CBCentralManager!, willRestoreState dict: [NSObject : AnyObject]!)
OS X 10.10
To
optional func centralManager(_ central: CBCentralManager, willRestoreState dict: [String : AnyObject])
OS X 10.7

DeclarationIntroduction
From
func centralManagerDidUpdateState(_ central: CBCentralManager!)
OS X 10.10
To
func centralManagerDidUpdateState(_ central: CBCentralManager)
OS X 10.7

Raw Value Type
From--
ToInt

Declaration
From
class CBCharacteristic : NSObject {
    weak var service: CBService! { get }
    var UUID: CBUUID! { get }
    var properties: CBCharacteristicProperties { get }
    var value: NSData! { get }
    var descriptors: [AnyObject]! { get }
    var isBroadcasted: Bool { get }
    var isNotifying: Bool { get }
}
To
class CBCharacteristic : NSObject {
    unowned(unsafe) var service: CBService { get }
    var UUID: CBUUID { get }
    var properties: CBCharacteristicProperties { get }
    var value: NSData? { get }
    var descriptors: [CBDescriptor]? { get }
    var isBroadcasted: Bool { get }
    var isNotifying: Bool { get }
}

Declaration
From
var descriptors: [AnyObject]! { get }
To
var descriptors: [CBDescriptor]? { get }

Declaration
From
weak var service: CBService! { get }
To
unowned(unsafe) var service: CBService { get }

Modified CBCharacteristic.UUID
Declaration
From
var UUID: CBUUID! { get }
To
var UUID: CBUUID { get }

Declaration
From
var value: NSData! { get }
To
var value: NSData? { get }

DeclarationProtocols
From
struct CBCharacteristicProperties : RawOptionSetType {
    init(_ rawValue: Int)
    init(rawValue rawValue: Int)
    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: Int)
    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

Raw Value Type
From--
ToInt

Modified CBDescriptor
Declaration
From
class CBDescriptor : NSObject {
    weak var characteristic: CBCharacteristic! { get }
    var UUID: CBUUID! { get }
    var value: AnyObject! { get }
}
To
class CBDescriptor : NSObject {
    unowned(unsafe) var characteristic: CBCharacteristic { get }
    var UUID: CBUUID { get }
    var value: AnyObject? { get }
}

Declaration
From
weak var characteristic: CBCharacteristic! { get }
To
unowned(unsafe) var characteristic: CBCharacteristic { get }

Modified CBDescriptor.UUID
Declaration
From
var UUID: CBUUID! { get }
To
var UUID: CBUUID { get }

Declaration
From
var value: AnyObject! { get }
To
var value: AnyObject? { get }

DeclarationProtocolsRaw 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
}
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 MaxConnection
}
extension CBError : Hashable, Equatable, __BridgedNSError, ErrorType, RawRepresentable, _ObjectiveCBridgeableErrorType, _BridgedNSError {
}
extension CBError : Hashable, Equatable, __BridgedNSError, ErrorType, RawRepresentable, _ObjectiveCBridgeableErrorType, _BridgedNSError {
}
Equatable, ErrorType, Hashable, RawRepresentableInt

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 UUID: CBUUID?
    var properties: CBCharacteristicProperties
    var value: NSData?
    var descriptors: [CBDescriptor]?
    init(type UUID: CBUUID?, properties properties: CBCharacteristicProperties, value value: NSData?, permissions permissions: CBAttributePermissions)
}

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.UUID
Declaration
From
var UUID: CBUUID!
To
var UUID: CBUUID?

Declaration
From
var value: NSData!
To
var value: NSData?

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?)

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 UUID: CBUUID?
    var isPrimary: Bool
    var includedServices: [CBService]?
    var characteristics: [CBCharacteristic]?
    init(type UUID: CBUUID?, primary isPrimary: Bool)
}

Declaration
From
var characteristics: [AnyObject]!
To
var characteristics: [CBCharacteristic]?

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 CBMutableService.UUID
Declaration
From
var UUID: CBUUID!
To
var UUID: CBUUID?

Modified CBPeripheral
Declaration
From
class CBPeripheral : NSObject, NSCopying {
    unowned(unsafe) var delegate: CBPeripheralDelegate!
    var UUID: CFUUID! { get }
    var identifier: NSUUID! { get }
    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 : NSObject, NSCopying {
    unowned(unsafe) var delegate: CBPeripheralDelegate?
    var UUID: CFUUID { get }
    var identifier: NSUUID { get }
    var name: String? { get }
    var RSSI: NSNumber? { get }
    var isConnected: Bool { 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 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)
}

Declaration
From
unowned(unsafe) 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.identifier
Declaration
From
var identifier: NSUUID! { get }
To
var identifier: NSUUID { get }

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)

Declaration
From
var RSSI: NSNumber! { get }
To
var RSSI: NSNumber? { get }

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 CBPeripheralAuthorizationStatus [enum]
Raw Value Type
From--
ToInt

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!, 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 peripheralDidInvalidateServices(_ peripheral: CBPeripheral)
    optional func peripheral(_ peripheral: CBPeripheral, didModifyServices invalidatedServices: [CBService])
    optional func peripheralDidUpdateRSSI(_ peripheral: CBPeripheral, 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?)
}

DeclarationIntroduction
From
optional func peripheral(_ peripheral: CBPeripheral!, didDiscoverCharacteristicsForService service: CBService!, error error: NSError!)
OS X 10.10
To
optional func peripheral(_ peripheral: CBPeripheral, didDiscoverCharacteristicsForService service: CBService, error error: NSError?)
OS X 10.7

DeclarationIntroduction
From
optional func peripheral(_ peripheral: CBPeripheral!, didDiscoverDescriptorsForCharacteristic characteristic: CBCharacteristic!, error error: NSError!)
OS X 10.10
To
optional func peripheral(_ peripheral: CBPeripheral, didDiscoverDescriptorsForCharacteristic characteristic: CBCharacteristic, error error: NSError?)
OS X 10.7

DeclarationIntroduction
From
optional func peripheral(_ peripheral: CBPeripheral!, didDiscoverIncludedServicesForService service: CBService!, error error: NSError!)
OS X 10.10
To
optional func peripheral(_ peripheral: CBPeripheral, didDiscoverIncludedServicesForService service: CBService, error error: NSError?)
OS X 10.7

DeclarationIntroduction
From
optional func peripheral(_ peripheral: CBPeripheral!, didDiscoverServices error: NSError!)
OS X 10.10
To
optional func peripheral(_ peripheral: CBPeripheral, didDiscoverServices error: NSError?)
OS X 10.7

Declaration
From
optional func peripheral(_ peripheral: CBPeripheral!, didModifyServices invalidatedServices: [AnyObject]!)
To
optional func peripheral(_ peripheral: CBPeripheral, didModifyServices invalidatedServices: [CBService])

DeclarationIntroduction
From
optional func peripheral(_ peripheral: CBPeripheral!, didUpdateNotificationStateForCharacteristic characteristic: CBCharacteristic!, error error: NSError!)
OS X 10.10
To
optional func peripheral(_ peripheral: CBPeripheral, didUpdateNotificationStateForCharacteristic characteristic: CBCharacteristic, error error: NSError?)
OS X 10.7

DeclarationIntroduction
From
optional func peripheral(_ peripheral: CBPeripheral!, didUpdateValueForCharacteristic characteristic: CBCharacteristic!, error error: NSError!)
OS X 10.10
To
optional func peripheral(_ peripheral: CBPeripheral, didUpdateValueForCharacteristic characteristic: CBCharacteristic, error error: NSError?)
OS X 10.7

DeclarationIntroduction
From
optional func peripheral(_ peripheral: CBPeripheral!, didUpdateValueForDescriptor descriptor: CBDescriptor!, error error: NSError!)
OS X 10.10
To
optional func peripheral(_ peripheral: CBPeripheral, didUpdateValueForDescriptor descriptor: CBDescriptor, error error: NSError?)
OS X 10.7

DeclarationIntroduction
From
optional func peripheral(_ peripheral: CBPeripheral!, didWriteValueForCharacteristic characteristic: CBCharacteristic!, error error: NSError!)
OS X 10.10
To
optional func peripheral(_ peripheral: CBPeripheral, didWriteValueForCharacteristic characteristic: CBCharacteristic, error error: NSError?)
OS X 10.7

DeclarationIntroduction
From
optional func peripheral(_ peripheral: CBPeripheral!, didWriteValueForDescriptor descriptor: CBDescriptor!, error error: NSError!)
OS X 10.10
To
optional func peripheral(_ peripheral: CBPeripheral, didWriteValueForDescriptor descriptor: CBDescriptor, error error: NSError?)
OS X 10.7

Declaration
From
optional func peripheralDidUpdateName(_ peripheral: CBPeripheral!)
To
optional func peripheralDidUpdateName(_ peripheral: CBPeripheral)

DeclarationIntroduction
From
optional func peripheralDidUpdateRSSI(_ peripheral: CBPeripheral!, error error: NSError!)
OS X 10.10
To
optional func peripheralDidUpdateRSSI(_ peripheral: CBPeripheral, error error: NSError?)
OS X 10.7

Declaration
From
class CBPeripheralManager : NSObject {
    unowned(unsafe) var delegate: CBPeripheralManagerDelegate!
    var state: CBPeripheralManagerState { get }
    var isAdvertising: Bool { get }
    class func authorizationStatus() -> CBPeripheralAuthorizationStatus
    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() -> CBPeripheralAuthorizationStatus
    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)

Declaration
From
unowned(unsafe) var delegate: CBPeripheralManagerDelegate!
To
unowned(unsafe) var delegate: CBPeripheralManagerDelegate?

Declaration
From
init!(delegate delegate: CBPeripheralManagerDelegate!, queue queue: dispatch_queue_t!)
To
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--
ToInt

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)
}

DeclarationIntroduction
From
optional func peripheralManager(_ peripheral: CBPeripheralManager!, central central: CBCentral!, didSubscribeToCharacteristic characteristic: CBCharacteristic!)
OS X 10.10
To
optional func peripheralManager(_ peripheral: CBPeripheralManager, central central: CBCentral, didSubscribeToCharacteristic characteristic: CBCharacteristic)
OS X 10.9

DeclarationIntroduction
From
optional func peripheralManager(_ peripheral: CBPeripheralManager!, central central: CBCentral!, didUnsubscribeFromCharacteristic characteristic: CBCharacteristic!)
OS X 10.10
To
optional func peripheralManager(_ peripheral: CBPeripheralManager, central central: CBCentral, didUnsubscribeFromCharacteristic characteristic: CBCharacteristic)
OS X 10.9

DeclarationIntroduction
From
optional func peripheralManager(_ peripheral: CBPeripheralManager!, didAddService service: CBService!, error error: NSError!)
OS X 10.10
To
optional func peripheralManager(_ peripheral: CBPeripheralManager, didAddService service: CBService, error error: NSError?)
OS X 10.9

DeclarationIntroduction
From
optional func peripheralManager(_ peripheral: CBPeripheralManager!, didReceiveReadRequest request: CBATTRequest!)
OS X 10.10
To
optional func peripheralManager(_ peripheral: CBPeripheralManager, didReceiveReadRequest request: CBATTRequest)
OS X 10.9

DeclarationIntroduction
From
optional func peripheralManager(_ peripheral: CBPeripheralManager!, didReceiveWriteRequests requests: [AnyObject]!)
OS X 10.10
To
optional func peripheralManager(_ peripheral: CBPeripheralManager, didReceiveWriteRequests requests: [CBATTRequest])
OS X 10.9

DeclarationIntroduction
From
optional func peripheralManager(_ peripheral: CBPeripheralManager!, willRestoreState dict: [NSObject : AnyObject]!)
OS X 10.10
To
optional func peripheralManager(_ peripheral: CBPeripheralManager, willRestoreState dict: [String : AnyObject])
OS X 10.9

DeclarationIntroduction
From
optional func peripheralManagerDidStartAdvertising(_ peripheral: CBPeripheralManager!, error error: NSError!)
OS X 10.10
To
optional func peripheralManagerDidStartAdvertising(_ peripheral: CBPeripheralManager, error error: NSError?)
OS X 10.9

DeclarationIntroduction
From
func peripheralManagerDidUpdateState(_ peripheral: CBPeripheralManager!)
OS X 10.10
To
func peripheralManagerDidUpdateState(_ peripheral: CBPeripheralManager)
OS X 10.9

DeclarationIntroduction
From
optional func peripheralManagerIsReadyToUpdateSubscribers(_ peripheral: CBPeripheralManager!)
OS X 10.10
To
optional func peripheralManagerIsReadyToUpdateSubscribers(_ peripheral: CBPeripheralManager)
OS X 10.9

Raw Value Type
From--
ToInt

Raw Value Type
From--
ToInt

Modified CBService
Declaration
From
class CBService : NSObject {
    weak var peripheral: CBPeripheral! { get }
    var UUID: CBUUID! { get }
    var isPrimary: Bool { get }
    var includedServices: [AnyObject]! { get }
    var characteristics: [AnyObject]! { get }
}
To
class CBService : NSObject {
    unowned(unsafe) var peripheral: CBPeripheral { get }
    var UUID: CBUUID { get }
    var isPrimary: Bool { get }
    var includedServices: [CBService]? { get }
    var characteristics: [CBCharacteristic]? { get }
}

Declaration
From
var characteristics: [AnyObject]! { get }
To
var characteristics: [CBCharacteristic]? { get }

Declaration
From
var includedServices: [AnyObject]! { get }
To
var includedServices: [CBService]? { get }

Declaration
From
weak var peripheral: CBPeripheral! { get }
To
unowned(unsafe) var peripheral: CBPeripheral { get }

Modified CBService.UUID
Declaration
From
var UUID: CBUUID! { get }
To
var UUID: CBUUID { 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 }

Declaration
From
init!(CFUUID theUUID: CFUUID!) -> CBUUID
To
init(CFUUID theUUID: CFUUID)

Declaration
From
init!(data theData: NSData!) -> CBUUID
To
init(data theData: NSData)

Declaration
From
init!(NSUUID theUUID: NSUUID!) -> CBUUID
To
init(NSUUID theUUID: NSUUID)

Declaration
From
init!(string theString: String!) -> CBUUID
To
init(string theString: String)

Declaration
From
var UUIDString: String! { get }
To
var UUIDString: String { get }