I'm trying to update PKHUD (https://github.com/pkluz/PKHUD) to work with Xcode 6 beta 5 and am almost through except for one tiny detail:
internal class Window: UIWindow {
required internal init(coder aDecoder: NSCoder!) {
super.init(coder: aDecoder)
}
internal let frameView: FrameView
internal init(frameView: FrameView = FrameView()) {
self.frameView = frameView
// this is the line that bombs
super.init(frame: UIApplication.sharedApplication().delegate.window!.bounds)
rootViewController = WindowRootViewController()
windowLevel = UIWindowLevelNormal + 1.0
backgroundColor = UIColor.clearColor()
addSubview(backgroundView)
addSubview(frameView)
}
// more code here
}
Xcode gives me the error UIWindow? does not have a member named 'bounds'
.
I'm pretty sure this is a trivial mistake related to type-casting, but I've been unable to find the answer to this for a couple hours.
Also, this error occurs only in Xcode 6 beta 5, which means that the answer lies in something Apple changed recently.
All help is greatly appreciated.