iOS development-Project Combat Swift &swift 2.0 Project Development Summary One (common development)

Source: Internet
Author: User

Swift 2.0 Project Development summary One (common development)One: Implementation of new features (version judgment)
1Let Versionstr ="cfbundleshortversionstring"2Let cureentversion = Nsbundle.mainbundle (). infodictionary! [Versionstr] as!String3Let oldversion = (Nsuserdefaults.standarduserdefaults (). Objectforkey (VERSIONSTR) as? String)??""4 5     ifCureentversion.compare (oldversion) = =nscomparisonresult.ordereddescending {6 nsuserdefaults.standarduserdefaults (). SetObject (Cureentversion, FORKEY:VERSIONSTR)7 nsuserdefaults.standarduserdefaults (). Synchronize ()8     returnLeadpageviewcontroller ()9     }Ten  

Second: Rewrite the navigation bar of the push method, to achieve the unification and personalization of the left and right buttons
1 ifSelf.childViewControllers.count >0 {2Let VC = self.childviewcontrollers[0]3 4       ifSelf.childViewControllers.count = =1 {5Backbtn.settitle (vc.tabbaritem.title!, Forstate:. Normal)6}Else {7Backbtn.settitle ("return", Forstate:. Normal)8       }9 TenViewController.navigationItem.leftBarButtonItem =Uibarbuttonitem (CUSTOMVIEW:BACKBTN) Oneviewcontroller.hidesbottombarwhenpushed =true A   } -  - Super.pushviewcontroller (Viewcontroller, animated:animated) the   -  

III: New method for calculating cell height in iOS8 combined with bottom constraint in Xib
1 // Estimating the cell height 2        $ 3        // set the automatic layout style for TableView 4       Tablev.rowheight = Uitableviewautomaticdimension

iOS development-Project Combat Swift &swift 2.0 Project Development Summary One (common development)

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.