Converting to Swift 3 I get the compiler error:
Cannot invoke initializer for type 'UnsafeMutablePointer' with an argument list of type '(UnsafeMutableRawPointer?)'
when trying to create a typed pointer from an opaque pointer:
let imageRef = myUIImage.cgImage!
let context = CGContext(...)!
let rect = CGRect(...)
context.draw(imageref, in: rect)
var data = context.data
var dataType = UnsafeMutablePointer<UInt8>(data) //Throws the error
Why does this not work?