当我们尝试从库中显示警报时,出现此错误。在SceneDelegate上设置UIWindow需要帮助。
[Assert] Error in UIKit client: -[UIWindow setScreen:] should not be called if the client adopts UIScene lifecycle. Call -[UIWindow setWindowScene:] instead. 在用UIKit开发的任何呈现新视图的东西上,我也看到了这个错误。我不确定这不是一个未完成的底层应用程序接口问题,因为在我的任何项目代码中,我都没有直接调用setScreen。
我当前的代码如下
let contentView = ContentView()
let vc1 = UIHostingController(rootView: contentView)
let nav = UINavigationController(rootViewController: vc1)
if let windowScene = scene as? UIWindowScene {
let window = UIWindow(windowScene: windowScene)
window.rootViewController = nav
self.window = window
window.makeKeyAndVisible()
}发布于 2020-09-10 14:34:30
在使用新UIScene生命周期的应用程序中,系统ui元素RPSystemBroadcastPickerView不起作用。
当点击start Broadcast按钮时,广播没有开始,并且在日志中看到以下错误: Assert error in UIKit client:-UIWindow setScreen:如果客户端采用UIScene生命周期,则不应调用。改为调用-UIWindow setWindowScene:。
在使用AppDelegate管理应用程序生命周期时,此视图的工作方式与预期相同。
https://stackoverflow.com/questions/60075142
复制相似问题