Skip to content

Instantly share code, notes, and snippets.

@AhiyaHiya
Created November 1, 2017 15:37
Show Gist options
  • Select an option

  • Save AhiyaHiya/e9e05f19b8f7fc213f11e9b2f615a557 to your computer and use it in GitHub Desktop.

Select an option

Save AhiyaHiya/e9e05f19b8f7fc213f11e9b2f615a557 to your computer and use it in GitHub Desktop.
Set the version label from the plist info (iOS and macOS)
func setVersionLabel()
{
let mainBundle = Bundle.main
let version = mainBundle.infoDictionary!["CFBundleShortVersionString"] as! String
let build = mainBundle.infoDictionary![kCFBundleVersionKey as String] as! String
versionLabel.text = "Version \(version) Build: \(build)"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment