我在xcode8中编写此代码,但我有错误:
Missing required parameters for [Route: resource] [URI: resource/{Resource_ID}])
但我有错误,UIApplication没有成员keywindow
我该怎么做!?
答案 0 :(得分:0)
经过大量搜索后我发现它如何解决:
if let window = UIApplication.shared.delegate?.window {
let blackView = UIView()
blackView.backgroundColor = UIColor.black
window?.addSubview(blackView)
blackView.frame = (window?.frame)!
}
SOLVE:
shared.delegate.window
而不是
sharedApplication.keywindow
和
blackView.frame = window.frame
将其更改为
blackView.frame = (window?.frame)!
答案 1 :(得分:0)
解决:(斯威夫特3)
if let window = UIApplication.shared.keyWindow {
let blackView = UIView()
blackView.backgroundColor = UIColor.black
window.addSubview(blackView)
blackView.frame = window.frame
}