Reputation: 77661
Whenever I have done apps that require a log in I have always placed the login screen as the rootViewController
of a UINavigationController
.
I've been wondering whether or not this is the best way to approach it?
Is there a standard pattern for doing this?
Should I maybe have a modal screen on top of the rootViewController that acts as a login screen?
Upvotes: 0
Views: 107
Reputation: 3487
I have been using a modal view controller for 2 reasons:
1: Because i had to implement an auto login feature if the user had been previously logged in and didn't want to have to add a whole VC when navigating to the home screen when the app auto logs in. IT makes the loading and animation faster to loose an extra VC.
2: I didn't want the encryption code loaded for the entire duration of the application incase someone wanted to snapshot the encryption and authentication process. Not sure this is entirely necessary though, but it seemed bad to have your login code in memory for the duration of the application.
However in future applications im going to do neither, and create a login view that animates in and out when asking for login details. This in my opinion looks best, as modal view controllers dont have the nicest of animations.
Upvotes: 1