Reputation: 33
I converted my project to Swift 3. My code was fine and after conversion I have this:
fileprivate func createImage() -> UIImage {
return ImageProcessor.imageFromARGB32Bitmap(Data(bytes: UnsafePointer<UInt8>(&pixelBuffer), count: pixelBuffer.count), width: framebufferwidth, height: framebufferheight)
}
The error:
Ambiguous use of Init
How to fix it?
Upvotes: 2
Views: 3247
Reputation: 47896
Try this:
return ImageProcessor.imageFromARGB32Bitmap(Data(bytes: pixelBuffer), width: framebufferwidth, height: framebufferheight)
(Assuming ImageProcessor.imageFromARGB32Bitmap
takes Data
as its first parameter.)
You have no need to get an UnsafePointer from an Array of UInt8
.
Upvotes: 1