Skip to content

Commit bcb42ac

Browse files
committed
Hidable mimicrate bar.
1 parent cefa01c commit bcb42ac

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

Sources/NativeUIKit/Controllers/Navigation/NativeNavigationController.swift

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,28 @@ open class NativeNavigationController: SPNavigationController {
4040
}
4141
}
4242

43+
open override func setToolbarHidden(_ hidden: Bool, animated: Bool) {
44+
if let barView = mimicrateToolBarView {
45+
if animated {
46+
47+
if barView.isHidden && !hidden {
48+
barView.isHidden = false
49+
barView.alpha = .zero
50+
}
51+
52+
UIView.animate(withDuration: 0.12, delay: .zero, options: [.beginFromCurrentState, .curveEaseInOut], animations: {
53+
barView.alpha = hidden ? .zero : 1
54+
}) { completed in
55+
barView.isHidden = hidden
56+
}
57+
} else {
58+
barView.isHidden = hidden
59+
}
60+
} else {
61+
super.setToolbarHidden(hidden, animated: animated)
62+
}
63+
}
64+
4365
// MARK: - Layout
4466

4567
open override func viewDidLayoutSubviews() {

0 commit comments

Comments
 (0)