Read version from Info.plist

后端 未结 5 1483
北荒
北荒 2021-01-30 02:49

I want to read the bundle version info from Info.plist into my code, preferably as a string. How can I do this?

5条回答
  •  醉话见心
    2021-01-30 03:42

    Swift 3:

    let appBuildNumber = Bundle.main.infoDictionary!["CFBundleVersion"] as! String
    let appVersion = Bundle.main.infoDictionary!["CFBundleShortVersionString"] as! String
    

提交回复
热议问题