Version String in Swift: Need to get a version string that is defined in XCode Project?.


Basically it is just getting value out of your Bundle. In Objective C, based on this post.

Which is simply getting value from you bundle with these constant keys to get your desired values.

  • CFBundleVersion for Build number
  • CFBundleShortVersionString for Version String

And here is a swift version.