SwiftUI通过代码实现页面跳转
2022-02-02 本文已影响0人
蓝不蓝编程
let screnDelegate: UIWindowSceneDelegate? = {
var uiScreen: UIScene?
UIApplication.shared.connectedScenes.forEach { (screen) in
uiScreen = screen
}
return (uiScreen?.delegate as? UIWindowSceneDelegate)
}()
screnDelegate?.window!?.rootViewController = UIHostingController(rootView: 页面View());