I use a method within my code to convert raw bytes to Ints.
The code I used previously was:
func convert(from data: Data) -> Int? {
return data.withUnsafeBytes { $0.pointee }
}
This used to work correctly, until XCode 8.3 with Swift 3.1 support came along. Now the same method works correctly on iOS 10 devices, but fails (returns absurdly large numbers) on devices (and simulators) running iOS 9.3.
Example code: Data(bytes: [0]).withUnsafeBytes { $0.pointee } as Int returns -4611686018427387903
Anyone experiencing the same issue?