我的代码使用了 inappview 依赖项,但抛出了这个警告: iOS 9.0 中不推荐使用 Setter for 'statusBarStyle': Use -[UIViewController preferredStatusBarStyle]
如何将此弃用的代码转换为新版本的代码?
public func hide() {
isHidden = true
// Run later to avoid the "took a long time" log message.
DispatchQueue.main.async(execute: {() -> Void in
self.presentingViewController?.dismiss(animated: true, completion: {() -> Void in
self.tmpWindow?.windowLevel = UIWindow.Level(rawValue: 0.0)
UIApplication.shared.delegate?.window??.makeKeyAndVisible()
if self.previousStatusBarStyle != -1 {
UIApplication.shared.statusBarStyle = UIStatusBarStyle(rawValue: self.previousStatusBarStyle)!
}
})
})
}