cloudcity / ZeroToBLE-Part2-Swift

Swiftified version of the demo app created for Part Two of the Zero to BLE series of blog articles.
24 stars 13 forks source link

Does not compile for Swift3 & iOS 10.2 target #1

Open jaimeyu opened 7 years ago

jaimeyu commented 7 years ago

After running the migration tool at start up to bring it up to Swift3, I hit this compilation error on line: let enableBytes = Data(bytes: UnsafePointer(&enableValue), count: sizeof(UInt8))

Error: ZeroToBLE-Part2-Swift-master/BLETemperatureReaderSwift/BLETemperatureReaderSwift/TemperatureViewController.swift:482:43: Ambiguous use of 'init'

jaimeyu commented 7 years ago

Perhaps a fix for Swift 3 is:

        let enableValue:UInt8 = 1
        let enableBytes = Data(bytes: [enableValue])