Judging the software is not the first time to start

Source: Internet
Author: User

In the opening of a software we have a simple Guide page or Welcome interface, guide page can help users clearly understand the use of software, improve the user's sense of software.


-(BOOL) Application: (UIApplication *) application didfinishlaunchingwithoptions: (nsdictionary *) launchOptions
Self.window = [[UIWindow alloc] initwithframe:[[uiscreen mainscreen] bounds]];

NSString *key = @ "Cfbundleversion";

Remove the version number of the last-used software stored in the sandbox
Nsuserdefaults *defaults = [Nsuserdefaults standarduserdefaults];
NSString *lastversion = [defaults stringforkey:key];

Get the version number of the current software
NSString *currentversion = [NSBundle Mainbundle].infodictionary[key];

if ([CurrentVersion isequaltostring:lastversion]) {
Show status bar, old version does not show new features
Application.statusbarhidden = NO;

Self.window.rootViewController = [[Iwtabbarviewcontroller alloc] init];
} else {//new version shows new
Self.window.rootViewController = [[Iwnewfeatureviewcontroller alloc] init];
Store new version
[Defaults setobject:currentversion Forkey:key];
[Defaults synchronize];
[Self.window makekeyandvisible];
return YES;

Determine if the software is the first time to start

Related Article

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.