I know this question was asked several times but I really don't understand it.
I want to extract a value from a bluetooth device (miband). In swift 2 it worked like this:
func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor characteristic: CBCharacteristic, error: Error?) {
if characteristic.uuid.uuidString == "FF06" {
let value = UnsafePointer<Int>(characteristic.value!.bytes).memory
print("Steps: \(value)")
}
}
But in swift 3 it throws an error:
Cannot invoke initializer for type 'UnsafePointer<Int>' with an argument list of type '(UnsafeRawPointer)'
And I have no idea how to migrate that to swift 3.