Skip to content
This repository was archived by the owner on Sep 9, 2019. It is now read-only.
This repository was archived by the owner on Sep 9, 2019. It is now read-only.

Fails to work if logout and then back in #39

Description

@MaeseppTarvo

I checked it out also and it seems that the problem is that if you "logout" and set your initial viewcontroller to your welcome view and "log in" again. It keeps the previous menu underneath. If you "Log back in" then even the selected index is the last one.

I am using this to instantiate(log out) the "WelcomeViewController" and I think that is the problem.

let storyboard = UIStoryboard(name: "Landing", bundle: nil)
        
 let controller = storyboard.instantiateViewController(withIdentifier: "WelcomeViewController")
        
        
 let appDelegate = UIApplication.shared.delegate as! AppDelegate
        
 appDelegate.window?.rootViewController = controller

And that is how I "log in":

let storyboard = UIStoryboard(name: "Main", bundle: nil)
                    
let controller = storyboard.instantiateViewController(withIdentifier: "NavigationController")

let appDelegate = UIApplication.shared.delegate as! AppDelegate
                    
 self.dismiss(animated: false, completion: { 
           appDelegate.window?.rootViewController = controller
 })

You can check out the following images:

  1. This is in normal phase

normal1

  1. This is after logout and back login

bad

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions