// 获取应用文件的详细信息,返回一个字典
let dict = NSBundle.mainBundle().infoDictionary!
// 获取version,对应工程general中的version
let version = dict["CFBundleShortVersionString"] as! String
// 获取bundle,对应工程general中的bundle
let bundle = dict["CFBundleVersion"] as! String
转载于:https://my.oschina.net/ozawa4865/blog/877328