Commit 6f9f6ca9 by Daniel Dahan

issue-650: Fixed issue where NavigationBar.backButton would incorrectly be laid…

issue-650: Fixed issue where NavigationBar.backButton would incorrectly be laid out when caching view controllers.
parent e19cd9cb
......@@ -3,6 +3,7 @@
* [pr-979](https://github.com/CosmicMind/Material/pull/979): Added `visibilityOff` icon and updated `TextField` to utilize it.
* [issue-982](https://github.com/CosmicMind/Material/issues/982): Updated Icon let declarations to var declarations to allow custom icon sets.
* [issue-980](https://github.com/CosmicMind/Material/issues/980): Added `@objc` to extension properties in Material+UIView.
* [issue-650](https://github.com/CosmicMind/Material/issues/650): Fixed issue where `NavigationBar.backButton` would incorrectly be laid out when caching view controllers.
## 2.12.16
......
......@@ -173,6 +173,14 @@ extension NavigationController: UINavigationBarDelegate {
return true
}
public func navigationBar(_ navigationBar: UINavigationBar, didPop item: UINavigationItem) {
if let index = item.leftViews.index(of: item.backButton) {
item.leftViews.remove(at: index)
}
item.backButton.removeTarget(self, action: #selector(handle(backButton:)), for: .touchUpInside)
}
/// Handler for the backbutton.
@objc
internal func handle(backButton: UIButton) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment