简体   繁体   中英

How to show build version with schema Xcode 11

How do you show the build version with the scheme in the application?

For example, if the app build version is 1.0.2 and the build scheme is staging then I want to show 1.0.2-staging, like when the app center builds the application and then the name of the application would be shown in this way (1.0.2-staging).

I am not exactly sure what you mean by "build scheme", but these are 2 examples of how to get information from the Info.plist:

let version = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String
let build = Bundle.main.infoDictionary?["CFBundleVersion"] as? String

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM