since i converted my Code to Swift 3 the error occurs.
'init is unavailable: use 'withMemoryRebound(to:capacity:_)' to temporarily view memory as another layout-compatible type.
Here is my Code:
func parseHRMData(data : NSData!)
{
var flags : UInt8
var count : Int = 1
var zw = [UInt8](count: 2, repeatedValue: 0)
flags = bytes[0]
/*----------------FLAGS----------------*/
//Heart Rate Value Format Bit
if([flags & 0x01] == [0 & 0x01])
{
//Data Format is set to UINT8
//convert UINT8 to UINT16
zw[0] = bytes[count]
zw[1] = 0
bpm = UnsafePointer<UInt16>(zw).memory
print("HRMLatitude.parseData Puls(UINT8): \(bpm)BPM")
//count field index
count = count + 1
}
How can I fix this error?
Thanks in advance!