swift 獲取app版本號及 ios 版本號


swift 獲取app版本號及 ios 版本號

func versionCheck(){

        let infoDictionary = NSBundle.mainBundle().infoDictionary

        let appDisplayName: AnyObject? = infoDictionary!["CFBundleDisplayName"]

        let majorVersion : AnyObject? = infoDictionary! ["CFBundleShortVersionString"]

        let minorVersion : AnyObject? = infoDictionary! ["CFBundleVersion"]

        let appversion = majorVersion as String

        let iosversion : NSString = UIDevice.currentDevice().systemVersion   //ios 版本

        let identifierNumber = UIDevice.currentDevice().identifierForVendor   //設備 udid

        let systemName = UIDevice.currentDevice().systemName   //設備名稱

        let model = UIDevice.currentDevice().model   //設備型號

        let localizedModel = UIDevice.currentDevice().localizedModel   //設備區域化型號 A1533

 

        

        println(appversion)

    }





majorVersion 主程序版本號

minorVersion build 版本號
 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM