1. Pure code Development first thing to do, delete storybroad two files and the two columns associated with Info->custom IOS Target properties
2. Create two different viewcontroller, now assume one as a welcome interface (or product introduction), a second direct login as the main interface
The code that will implement the effect in 3.AppDelegate is as follows:
1 #import "AppDelegate.h"2 #import "StartViewController.h"3 #import "MainViewController.h"4 5 @implementationappdelegate6 7-(BOOL) Application: (UIApplication *) application didfinishlaunchingwithoptions: (Nsdictionary *) Launchoptions8 {9 //Override point for customization after application launch.TenSelf.window =[[UIWindow alloc]initwithframe:[[uiscreen mainscreen] bounds]; One AMainviewcontroller * MAINVC =[[Mainviewcontroller alloc]init]; - //launchimage (4photo) -Startviewcontroller * STARTVC =[[Startviewcontroller alloc]init]; theUinavigationcontroller *Navi; - //If the decision is to start the program for the first time -Nsuserdefaults *userdefaults =[Nsuserdefaults standarduserdefaults]; - +BOOL IsFirst = [Userdefaults boolforkey:@"Isfirststartup"]; - //Isfirst for the first time <nil> + if(!IsFirst) A { at //start the program for the first time -[Userdefaults setbool:yes Forkey:@"Isfirststartup"]; - //the above has been set Isfirst Yes -Navi =[[Uinavigationcontroller ALLOC]INITWITHROOTVIEWCONTROLLER:STARTVC]; - } - Else in { -Navi =[[Uinavigationcontroller ALLOC]INITWITHROOTVIEWCONTROLLER:MAINVC]; to } +Self.window.rootViewController =Navi; -Self.window.backgroundColor =[Uicolor Whitecolor]; the [Self.window makekeyandvisible]; * returnYES; $}
4. Next we can add the interface that we need to launch the app presentation for the first time in Startviewcontroller, and continue to extend other unfinished work in Mainviewcontroller.
iOS Mobile Welcome screen start-up