What is the best practice of switching between multiple views; change rootViewController or use modal views?
Installing rootViewController :
let storyBoard : UIStoryboard = UIStoryboard(name: "Main", bundle: nil) var vc : UIViewController = storyBoard.instantiateViewControllerWithIdentifier("viewTarget") as TargetViewController var window :UIWindow = UIApplication.sharedApplication().keyWindow! window.rootViewController = vc; window.makeKeyAndVisible()
Modal view change:
let storyBoard : UIStoryboard = UIStoryboard(name: "Main", bundle: nil) let initViewController: UIViewController = storyBoard.instantiateViewControllerWithIdentifier("viewTarget") as TargetViewController self.presentViewController(initViewController,animated: false, nil)
I am confused about what to use when I need to present the user some other representation.
ps In my case, I have an application starting with the login form as rootViewController . After logging in, I think it's best to change rootViewController , but am I right?
source share