Properly update navigation title on iOS
This commit is contained in:
parent
83d10e5a28
commit
5d20a7f71b
1 changed files with 3 additions and 2 deletions
|
@ -35,6 +35,7 @@ class PostViewController: UIViewController, UIPopoverPresentationControllerDeleg
|
||||||
}
|
}
|
||||||
|
|
||||||
self.view.window?.windowScene!.title = windowTitle
|
self.view.window?.windowScene!.title = windowTitle
|
||||||
|
navigationItem.title = windowTitle
|
||||||
}
|
}
|
||||||
|
|
||||||
override func viewWillAppear(_ animated: Bool) {
|
override func viewWillAppear(_ animated: Bool) {
|
||||||
|
@ -57,12 +58,12 @@ class PostViewController: UIViewController, UIPopoverPresentationControllerDeleg
|
||||||
navigationItem.leftBarButtonItem = UIBarButtonItem(title: "Done", style: .plain, target: self, action: #selector(closePopup))
|
navigationItem.leftBarButtonItem = UIBarButtonItem(title: "Done", style: .plain, target: self, action: #selector(closePopup))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updateWindowTitle()
|
||||||
}
|
}
|
||||||
|
|
||||||
override func viewDidAppear(_ animated: Bool) {
|
override func viewDidAppear(_ animated: Bool) {
|
||||||
super.viewDidAppear(animated)
|
super.viewDidAppear(animated)
|
||||||
|
|
||||||
updateWindowTitle()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc func closePopup() {
|
@objc func closePopup() {
|
||||||
|
|
Reference in a new issue