Getting the version number of your program isn't the most obvious thing to do. So, here is now I get at it.
let versionText = Bundle.main.infoDictionary!["CFBundleShortVersionString"] as? String
let buildText = Bundle.main.infoDictionary!["CFBundleVersion"] as? String