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

Screen-Shot-2558-12-18-at-22.48.46

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.