Search code examples
iosswiftxcodeuinavigationcontroller

How to use navigation controller in complex flow


let me explain the context. It's my first time working with splashscreen and complex flow in xcode, so i appreciate to much your help.

My flow is like the image above

flow

In splashVC I have to check if user is logged or not.. if logged, then I have to go to Home, if not, have to go to Login.

In LoginVC I can go to home, or to recover password.

In Home, I have 2 user types, when type one, i go to X, when type two, i go to Y.

I can go to profile VC from Home, X and Y.

Now I'm facing a problem. I only worked (I'm newbie) with simples flows and one navigation controller.. it's necessary to use more navigations here? or how can i achieve this?

In the design appears the navigation bar (back button) and a title, for that I'm asking for navigation controller.

I didn't embed any VC in navigation controller yet, and when I perform Segue to another VC, the next one appears over, like image above. So, It's necessary to work with navigation? Or how can I dismiss the previous VC and achieve that the 2nd one not look like a modal.

modal

Thanks in advance.


Solution

  • If you wish to do it with programmatically :

    let vc = UIViewController() // your case profilevc will be I think
    vc.modalPresentationStyle = .fullScreen
    self.present(vc, animated: true, completion: nil)
    

    or storyboard :

    enter image description here