rootviewcontroller

How to present login screen only when a userdefaults key doesn't exist?

点点圈 提交于 2019-12-06 16:45:26
I am trying to develop an application (still learning) where i present a logon screen which takes a username and password - this then goes off to a web service to authenticate and returns an access token. The access token is then stored in userdefaults and then presents a new view controller which gives access to the secured data. My problem is that when i close my app - force close, it then asks to login again. Because my login view controller is the initial view controller then i added a check to see if access token exists in userdefaults and present the new view controller which gives

Changing root view controller of a iOS Window

梦想与她 提交于 2019-11-26 17:06:33
Is the root view controller of a iOS Window usually initialized once in the beginning to a tab bar controller or navigation controller? Is it okay to change the root view controller multiple times within an app? I have a scenario where the top view is different based on user action. I was thinking of having a navigation controller with the top view controller having the image of the splash screen, and pushing/popping view controllers as required. Alternately, I can keep changing the window's top view controller. Which will be a better approach? It is more usual to use a "presented view

Changing root view controller of a iOS Window

这一生的挚爱 提交于 2019-11-26 05:14:01
问题 Is the root view controller of a iOS Window usually initialized once in the beginning to a tab bar controller or navigation controller? Is it okay to change the root view controller multiple times within an app? I have a scenario where the top view is different based on user action. I was thinking of having a navigation controller with the top view controller having the image of the splash screen, and pushing/popping view controllers as required. Alternately, I can keep changing the window\'s