Hi folks, I have issues converting this old snippet I found on github to Swift 4. I must say that I'm not used to Unsafe* family API, or otherwise I would not bother asking.
The function that requires the pointer looks like this:
@available(OSX 10.3, *)
public func vImageHistogramCalculation_ARGB8888(_ src: UnsafePointer<vImage_Buffer>, _ histogram: UnsafeMutablePointer<UnsafeMutablePointer<vImagePixelCount>?>, _ flags: vImage_Flags) -> vImage_Error
So the code that is not working looks simplified like this:
let array = [UInt](repeating: 0, count: 256)
// error: Cannot invoke initializer for type 'UnsafeMutablePointer<UInt>' with an argument list of type '([UInt])'
let pointer = UnsafeMutablePointer<UInt>(array)
Would be nice if I can get an explanation on how I should fix this issue and convert it to Swift 4.