Wrapped view controllers in navigation controllers to add large titles, added "Last updated" string in information view controller

This commit is contained in:
Deniz Duezgoeren
2019-08-03 11:01:56 +02:00
parent 7ba1f17fba
commit 866b886840
9 changed files with 140 additions and 128 deletions
+2 -7
View File
@@ -10,7 +10,6 @@ import UIKit
class PersonalPlanViewController: PlanViewController {
@IBOutlet weak var toolbar: UINavigationBar!
let prefs = UserDefaults.standard
@IBAction func toolbarButtonCustomise(_ sender: UIBarButtonItem) {
@@ -44,9 +43,9 @@ class PersonalPlanViewController: PlanViewController {
let user = self.prefs.string(forKey: "username")
if (user != nil && user != "") {
if (user!.last == "x" || user!.last == "s" || user!.last == "z") {
self.toolbar!.topItem!.title = "\(user!)\(NSLocalizedString("nosplan", comment: ""))"
self.navigationController?.navigationBar.topItem?.title = "\(user!)\(NSLocalizedString("nosplan", comment: ""))"
} else {
self.toolbar!.topItem!.title = "\(user!)\(NSLocalizedString("splan", comment: ""))"
self.navigationController?.navigationBar.topItem?.title = "\(user!)\(NSLocalizedString("splan", comment: ""))"
}
}
}
@@ -62,9 +61,5 @@ class PersonalPlanViewController: PlanViewController {
override func getFromDatabase() -> [SubstModel] {
return df.getPersonalFromDatabase()
}
override func getToolbarBottomAnchor() -> NSLayoutYAxisAnchor {
return toolbar.bottomAnchor
}
}