Displays version number in Settings

This commit is contained in:
Riley Testut
2020-01-13 13:32:55 -08:00
parent c79281cc32
commit c6a0437577
2 changed files with 21 additions and 2 deletions

View File

@@ -52,6 +52,8 @@ class SettingsViewController: UITableViewController
@IBOutlet private var backgroundRefreshSwitch: UISwitch!
@IBOutlet private var versionLabel: UILabel!
override var preferredStatusBarStyle: UIStatusBarStyle {
return .lightContent
}
@@ -78,6 +80,15 @@ class SettingsViewController: UITableViewController
debugModeGestureRecognizer.numberOfTouchesRequired = 3
self.tableView.addGestureRecognizer(debugModeGestureRecognizer)
if let version = Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String
{
self.versionLabel.text = NSLocalizedString(String(format: "AltStore %@", version), comment: "AltStore Version")
}
else
{
self.versionLabel.text = NSLocalizedString("AltStore", comment: "")
}
self.update()
}