15th: The first time you open the (update version) APP Wizard interface, the app Wizard

Source: Internet
Author: User

15th: The first time you open the (update version) APP Wizard interface, the app Wizard

The first time you open an APP, there will be a wizard, such as how to use the APP, what core functions are available, or introduction of new functions when a new version is released. It can be encapsulated into a class that inherits from UIView (ZWPushGuideView), and displayed in Xib, or pure code.

First, check the current version number.

1 // print info. content 2 ZWLog (@ "% @", [NSBundle mainBundle]. infoDictionary); 3 // The printed Array 4 ZWLog (@ "% @", [NSBundle mainBundle]. infoDictionary [@ "cfbundlepolicversionstring"]);

Then, use the class method to compare the current version number and the new version number.

1 + (void) show 2 {3 mainBundle]. infoDictionary [@ "cfbundle‑versionstring"]); 4 NSString * key = @ "cfbundle‑versionstring"; 5 // obtain the version number of the current software 6 NSString * currenVersion = [NSBundle mainBundle]. infoDictionary [key]; 7 // obtain the version 8 NSString * sandboxVersion = [[NSUserDefaults standardUserDefaults] stringForKey: key]; 9 if (! [CurrenVersion is1_tostring: sandboxVersion]) {10 // create window11 UIWindow * window = [UIApplication sharedApplication]. keyWindow; 12 ZWPushGuideView * guideView = [ZWPushGuideView guideView]; 13 guideView. frame = window. bounds; 14 [window addSubview: guideView]; 15 // store the latest version number 16 [[NSUserDefaults standardUserDefaults] setValue: currenVersion forKey: key]; 17 // synchronize to sandbox immediately 18 [[NSUserDefaults standardUserDefaults] synchronize]; 19} 20}

Finally in AppDelegate. m

// Display the push Guide [ZWPushGuideView show];

 

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.