OK. This is whacky. I've checked the various answers above, and this is the only one that seems to really hit the mark.
However, there doesn't seem to be an answer.
I am using Swift to create a new UIImage, exactly like this (Objective-C version):
UIImage *myImage = [[UIImage alloc] initWithCGImage: aCGImageRefAllocatedPreviously scale:aCGFloatScaleCalculatedPreviously orientation:UIImageOrientationUp];
That works fine. However, when I try the same exact call in Swift:
let myImage = UIImage ( CGImage: aCGImageAllocatedPreviously, scale:aCGFloatScaleCalculatedPreviously, orientation:UIImageOrientation.Up )
I get a compiler error, telling me that "scale" is an extra parameter.
This is the kind of error that you get when the signature is wrong.
However, it isn't wrong (as far as I can tell).
What I am doing, is creating a tutorial by exactly replicating an Objective-C function in Swift (I know, I know, Swift is different, so I shouldn't exactly replicate, but, as Bill Murray would say, "Baby Steps").
I'm wondering how the heck I'm screwing up.
If I call it with just the image (no scale or orientation), it works fine, but I need that scale.