[PanModal] Fix unbalanced calls to appearance (#52)
* [PanModal] Use init instead of viewDidLoad in NavigationController * [PanModal] Remove unbalanced calls to viewWillAppear/viewWillDisappear
This commit is contained in:
parent
0c6f9ff040
commit
9134d20032
|
|
@ -72,7 +72,6 @@ public class PanModalPresentationAnimator: NSObject {
|
|||
|
||||
// Calls viewWillAppear and viewWillDisappear
|
||||
fromVC.beginAppearanceTransition(false, animated: true)
|
||||
toVC.beginAppearanceTransition(true, animated: true)
|
||||
|
||||
// Presents the view in shortForm position, initially
|
||||
let yPos: CGFloat = presentable?.shortFormYPos ?? 0.0
|
||||
|
|
@ -94,7 +93,6 @@ public class PanModalPresentationAnimator: NSObject {
|
|||
}, config: presentable) { [weak self] didComplete in
|
||||
// Calls viewDidAppear and viewDidDisappear
|
||||
fromVC.endAppearanceTransition()
|
||||
toVC.endAppearanceTransition()
|
||||
transitionContext.completeTransition(didComplete)
|
||||
self?.feedbackGenerator = nil
|
||||
}
|
||||
|
|
@ -111,7 +109,6 @@ public class PanModalPresentationAnimator: NSObject {
|
|||
else { return }
|
||||
|
||||
// Calls viewWillAppear and viewWillDisappear
|
||||
fromVC.beginAppearanceTransition(false, animated: true)
|
||||
toVC.beginAppearanceTransition(true, animated: true)
|
||||
|
||||
let presentable = panModalLayoutType(from: transitionContext)
|
||||
|
|
@ -122,7 +119,6 @@ public class PanModalPresentationAnimator: NSObject {
|
|||
}, config: presentable) { didComplete in
|
||||
fromVC.view.removeFromSuperview()
|
||||
// Calls viewDidAppear and viewDidDisappear
|
||||
fromVC.endAppearanceTransition()
|
||||
toVC.endAppearanceTransition()
|
||||
transitionContext.completeTransition(didComplete)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,13 +12,17 @@ class NavigationController: UINavigationController, PanModalPresentable {
|
|||
|
||||
private let navGroups = NavUserGroups()
|
||||
|
||||
override var preferredStatusBarStyle: UIStatusBarStyle {
|
||||
return .lightContent
|
||||
init() {
|
||||
super.init(nibName: nil, bundle: nil)
|
||||
viewControllers = [navGroups]
|
||||
}
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
pushViewController(navGroups, animated: false)
|
||||
required init?(coder aDecoder: NSCoder) {
|
||||
fatalError()
|
||||
}
|
||||
|
||||
override var preferredStatusBarStyle: UIStatusBarStyle {
|
||||
return .lightContent
|
||||
}
|
||||
|
||||
override func popViewController(animated: Bool) -> UIViewController? {
|
||||
|
|
|
|||
Loading…
Reference in New Issue