简体   繁体   中英

iOS segue from modal to non-modal

I have a log in with email modal and from there I want to segue to the home screen non-modally.

Currently the flow works but is presenting the home screen modally. How would I present it normally?

from modal screen upon successful log in:

                let storyboard = UIStoryboard(name: "Main", bundle: nil)
                let vc = storyboard.instantiateViewController(identifier: "tabBarController")

//                self.present(vc, animated: true) //works but modally
                  self.show(vc, sender: self)  //works but modally

You could do something like this:

let storyboard = UIStoryboard(name: "Main", bundle: nil)
let vc = storyboard.instantiateViewController(identifier: "tabBarController")
vc.modalPresentationStyle = .overFullScreen
vc.modalTransitionStyle = .crossDissolve
self.show(vc, sender: self) 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM