If you want to show only one time you Login Screen then you need to help of Database.
I give simple example of how to work with database table.
Suppose your You have Table name is "Login"
add Login Table in 4 field
id - auto-inc.
username - TEXT;
password - TEXT;
status - TEXT, default 0;
Take two ViewController
1) LoginViewController
2) HomeViewController
And in application:didFinishLaunchingWithOptions
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
/// here you need to get status from "Login" table
if (status == 0)
{
/// code of initialize LoginViewController
self.window.rootViewController = self.LoginViewController;
}
else if (status == 1)
{
/// code of initialize HomeViewController
self.window.rootViewController = self.HomeViewController;
}
self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];
return YES;
}
In above code, When you start you app. first time at that time check condition of status from Login table.
first time you got status = 0 because we put default value of status is 0 so here,
self.window.rootViewController = self.LoginViewController;
At that time you enter userName and Password to your Login Screen.
after entered username and password you click on Login Button at That time you also need to fire Query of update status of you 'Login' table is 1
And when again you star your application at that time you ger status is 1 so,
self.window.rootViewController = self.HomeViewController;
So, you can not display your login screen again.