I have this code
let grayData = UnsafeMutablePointer<UInt8>(other: malloc(width * height * sizeof(UInt8)))
Which doesn't compile in Swift 3. How do I fix this?
In your case, you'd better use allocate(capacity:)
method.
let grayData = UnsafeMutablePointer<UInt8>.allocate(capacity: width * height)