我正在尝试更新PKHUD(https://github.com/pkluz/PKHUD)以使其与Xcode 6 beta 5兼容,并且已经接近完成,只剩一个小问题:
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提示我出错:UIWindow?没有名为'bounds'的成员
。 我相信这是与类型转换相关的微不足道的错误,但我已经花费了几个小时无法找到答案。
此外,这个错误仅在Xcode 6 beta 5中发生,这意味着答案在于苹果最近做的修改。
非常感谢您的所有帮助。