iOS Mobile Welcome screen start-up

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.