美文网首页SwiftUI
SwiftUI通过代码实现页面跳转

SwiftUI通过代码实现页面跳转

作者: 蓝不蓝编程 | 来源:发表于2022-02-02 20:16 被阅读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());
    

    相关文章

      网友评论

        本文标题:SwiftUI通过代码实现页面跳转

        本文链接:https://www.haomeiwen.com/subject/vrmrkrtx.html