Show released version number and build version number in about page

This commit is contained in:
Bob Sun 2017-03-02 15:15:28 +08:00
parent f75f949ab1
commit 8d9965f7da
No known key found for this signature in database
GPG key ID: 1F86BA2052FED3B4
2 changed files with 10 additions and 2 deletions

View file

@ -29,7 +29,7 @@ class AboutTableViewController: BasicStaticTableViewController {
let view = UIView()
let footerLabel = UILabel(frame: CGRect(x: 8, y: 15, width: tableView.frame.width, height: 60))
footerLabel.numberOfLines = 0
footerLabel.text = "Pass for iOS \(Globals.version)"
footerLabel.text = "Pass for iOS \(Bundle.main.releaseVersionNumber!) (\(Bundle.main.buildVersionNumber!))"
footerLabel.font = UIFont.preferredFont(forTextStyle: .footnote)
footerLabel.textColor = UIColor.lightGray
footerLabel.textAlignment = .center

View file

@ -20,10 +20,18 @@ class Globals {
static let repositoryPath = "\(libraryPath)/password-store"
static var passcodeConfiguration = PasscodeLockConfiguration()
static let version = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as! String
static let red = UIColor(red:1.00, green:0.23, blue:0.19, alpha:1.0)
static let blue = UIColor(red:0.00, green:0.48, blue:1.00, alpha:1.0)
private init() { }
}
extension Bundle {
var releaseVersionNumber: String? {
return infoDictionary?["CFBundleShortVersionString"] as? String
}
var buildVersionNumber: String? {
return infoDictionary?["CFBundleVersion"] as? String
}
}