swift 写法 如下
if let window = UIApplication.shared.windows.first(where: { (wd) -> Bool in
if wd.isKeyWindow
{
return true
}
else
{
return false
}
}){
self.frame = UIScreen.main.bounds
window.addSubview(self)
}
网友评论