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)