Brighton Madire Brighton Madire - 1 year ago 81
Swift Question

I want to translate this line to the Swift 3 current syntax code but seems there are some problems

CGContextDrawImage(imageContext, CGRect(origin: CGPointZero, size: image.size), cgImage)

When I change the code to this

CGContext.draw(imageContext as! CGImage, in: CGRect(origin: CGPointZero, size: image.size), byTiling: cgImage)

This error is showing

Cannot convert value of type
to expected type

Answer Source

Try this:

 imageContext.draw(cgImage, in: CGRect(origin:, size: image.size))
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download