0

I recently updated to Xcode 6.1 and have been working through fixing some bugs that have arisen. One issue I noticed was that my current code for setting the image of CGContextDrawImage no longer works.

This is my current code:

    CGContextDrawImage(ctx, self.bounds, UIImage(named: "RadialProgressFillOver"))

I just get the error:

Cannot invoke 'init' with an argument list of type

I've tried a few things and did some searching but I haven't found any solution to what to change for 6.1. Where am I going wrong?

1 Answer 1

2

The third parameter to CGContextDrawImage is a CGImageRef!. So use:

CGContextDrawImage(ctx, self.bounds, UIImage(named: "RadialProgressFillOver")?.CGImage)

Unfortunately, some of these warnings can be misleading, so you may have to go through each of the parameters, one by one, and carefully check both the type and optionality very carefully.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.