How to Remove a Previous ViewController

前端 未结 5 1898
予麋鹿
予麋鹿 2021-02-02 16:48

I am a student and pretty new to programming. I am trying to learn Objective-C/Swift in my spare time. I made a game using spriteKit with swift that has multiple menus/scenes. <

5条回答
  •  爱一瞬间的悲伤
    2021-02-02 17:21

    For swift 3 you can replace

    self.present(ViewController(), animated: false, completion: nil);
    

    with

    if let window = UIApplication.shared.keyWindow{
                window.rootViewController = UINavigationController(rootViewController: ViewController());
            }
    

提交回复
热议问题