I have a weird bug here.
I'm subclassing UIImageView to pass some custom properties to my views. If I don't add an init method to my subclass, everything's fine.
But if I do add the init (and I'm required to do so), then when I'm creating the frame view the compiler complains that an Int is not convertible to CGFloat.
Le subclass with Le init :
class CustomUIImageView : UIImageView {
let someParameter : Bool
init(someParameter: Bool) {
self.someParameter = someParameter
println("\(someParameter) is being initialized")
}
//Since the release of the GM version of XCode 6, it's asking me to pass this init below
//if I'm initializing a value. Frankly, I've no idea why, what's for nor what should I do about it.
required init(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
deinit {
println("\(someParameter) is being deinitialized")
}
}
And Le error when creating the Frame.
var myView: CustomUIImageView!
myView = CustomUIImageView(frame: (CGRectMake(0, 0, 100, 100)))
//compiler says "Int is not convertible to CGFloat".
Is this some kind of bug, or did I do something wrong (which is highly plausible)?
Edit : I've read that I need to convert directly to a CGFloat by doing like this :
myView = CustomUIImageView(frame: (CGRectMake(CGFloat(0), 0, 100, 100)))
But then compiler complains again saying that "Type () does not conform to protocol 'IntergerLiteralConvertible'".