iOS new features Guide page

Source: Internet
Author: User

There is one point of note:

Get version numberOne is called version, and one is called build, both of which can be selected in Xcode and click "Summary" to see. The key for version in the plist file is "cfbundleshortversionstring", which is the same as the version number on AppStore, and the key to build in Plist is "cfbundleversion". Represents the version number of build, which should be incremented by 1 after each build. Both of these values can be obtained in the program through the following code:1.Version nsstring *key = @ "cfbundleshortversionstring"; 2.buildnsstring *key =@ "cfbundleversion";

1. In APPDELEGATE.M

1-(BOOL) Application: (UIApplication *) application didfinishlaunchingwithoptions: (Nsdictionary *) launchoptions {2Self.window =[[UIWindow alloc] initwithframe:[[uiscreen mainscreen] bounds];3 4Self.window.backgroundColor =[Uicolor Whitecolor];5 6NSString *key =@"cfbundleshortversionstring";7     //Previous version number, storage sandbox8NSString *lastversion =[[Nsuserdefaults standarduserdefaults] objectforkey:key];9     //Current Version numberTenNSString *currentversion =[NSBundle Mainbundle].infodictionary[key]; OneNSLog (@"Front%@----current%@", lastversion,currentversion); A      -     if([CurrentVersion isequaltostring:lastversion]) { -Self.window.rootViewController = [ViewcontrollerNew];//to be true indicates that a file has been entered on the homepage the}Else{ -Self.window.rootViewController =[lgfnewfeatureviewcontrollerNew];//false means no files, no pages entered - [[Nsuserdefaults standarduserdefaults] setobject:currentversion Forkey:key]; - [[Nsuserdefaults standarduserdefaults] synchronize]; +     } - [Self.window makekeyandvisible]; +      A     returnYES; at}

2. In the VC of the new feature:

1 #import "LGFNEWfeatureViewController.h"2 #import "ViewController.h"3 4 #defineLgfnewfeaturecount 35 @interfaceLgfnewfeatureviewcontroller () <UIScrollViewDelegate>6@property (nonatomic,strong) Uiscrollview *ScrollView;7 8@property (nonatomic,strong) Uipagecontrol *Pagecontrol;9 Ten @end One  A @implementationLgfnewfeatureviewcontroller -  -- (void) Viewdidload { the [Super Viewdidload]; -     //Do any additional setup after loading the view. - [self setscrollerview]; - } +  --(void) setscrollerview{ +Self.scrollview = [UiscrollviewNew]; A_scrollview.frame =self.view.bounds; at_scrollview.contentsize = Cgsizemake (Lgfnewfeaturecount *self.view.frame.size.width,0); -_scrollview.bounces =NO; -_scrollview.pagingenabled =YES; -_scrollview.showshorizontalscrollindicator =NO; - [Self.view Addsubview:_scrollview]; -      for(inti =0; i<lgfnewfeaturecount; i++) { inUiimageview *imageview = [[Uiimageview alloc] Initwithframe:cgrectmake (Self.view.frame.size.width*i,0, Self.view.frame.size.width, Self.view.frame.size.height)]; -Imageview.image = [UIImage imagenamed:[nsstring stringWithFormat:@"%d", i+1]]; to [_scrollview Addsubview:imageview]; +         if(i = = lgfnewfeaturecount-1) { - [self setuplastimageview:imageview]; the         } *     } $_scrollview.Delegate=Self ;Panax Notoginseng      -Self.pagecontrol = [[Uipagecontrol alloc] Initwithframe:cgrectmake ( -, self.view.frame.size.height- -, self.view.frame.size.width- -, -)]; the_pagecontrol.numberofpages =Lgfnewfeaturecount; +_pagecontrol.currentpageindicatortintcolor =[Uicolor Orangecolor]; A_pagecontrol.userinteractionenabled =NO; the [Self.view Addsubview:_pagecontrol]; +      - } $  $-(void) Scrollviewdidscroll: (Uiscrollview *) scrollview{ -Self.pageControl.currentPage = self.scrollview.contentoffset.x/Self.view.frame.size.width; - } the  - Wuyi-(void) Setuplastimageview: (uiimageview*) imageview{ the     //Turn on user interaction -imageview.userinteractionenabled =YES; Wu     //1. Share -UIButton *sharedbtn =[[uibutton alloc] Initwithframe:cgrectmake ( the, self.view.frame.size.height- About, self.view.frame.size.width*0.5, self.view.frame.size.height*0.3)]; About      $[Sharedbtn setimage:[uiimage imagenamed:@"shared"] forstate:uicontrolstatenormal]; -[Sharedbtn setimage:[uiimage imagenamed:@"Sharedselect"] forstate:uicontrolstateselected]; -[Sharedbtn Settitle:@"Share to everyone"Forstate:uicontrolstatenormal]; -Sharedbtn.titleedgeinsets = Uiedgeinsetsmake (0, -,0,0); ASharedBtn.titleLabel.font = [Uifont systemfontofsize: -]; + [sharedbtn Settitlecolor:[uicolor Blackcolor] forstate:uicontrolstatenormal]; the [sharedbtn addtarget:self Action: @selector (Sharedbtnclick:) forcontrolevents:uicontroleventtouchupinside]; - [ImageView addsubview:sharedbtn]; $      the     //2. Start the Program home page theUIButton *startbtn = [[UIButton alloc] Initwithframe:cgrectmake ( -, self.view.frame.size.height*0.88, self.view.frame.size.width*0.4, self.view.frame.size.height*0.05)]; theStartBtn.layer.cornerRadius =12.0f; theStartBtn.layer.masksToBounds =YES; -Startbtn.backgroundcolor =[Uicolor Orangecolor]; in[Startbtn Settitle:@"Start the App tour"Forstate:uicontrolstatenormal]; the [startbtn addtarget:sharedbtn Action: @selector (Startbtnclick) forcontrolevents:uicontroleventtouchupinside]; the [ImageView addsubview:startbtn]; About      the } the  the-(void) Sharedbtnclick: (UIButton *) sharedbtn{ +sharedbtn.selected =!sharedbtn.selected; - } the Bayi-(void) startbtnclick{ theUIWindow *win =[uiapplication Sharedapplication].keywindow; theWin.rootviewcontroller = [ViewcontrollerNew]; -}



iOS new features Guide page

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.