|
@@ -52,7 +52,7 @@ class PagerTabStripViewController: UIViewController, UIScrollViewDelegate {
|
|
return .none
|
|
return .none
|
|
}
|
|
}
|
|
|
|
|
|
- override open func viewDidLoad() {
|
|
|
|
|
|
+ override func viewDidLoad() {
|
|
super.viewDidLoad()
|
|
super.viewDidLoad()
|
|
|
|
|
|
containerView = UIScrollView(frame: CGRect(x: 0, y: 0, width: view.bounds.width, height: view.bounds.height))
|
|
containerView = UIScrollView(frame: CGRect(x: 0, y: 0, width: view.bounds.width, height: view.bounds.height))
|
|
@@ -81,13 +81,13 @@ class PagerTabStripViewController: UIViewController, UIScrollViewDelegate {
|
|
childController.didMove(toParentViewController: self)
|
|
childController.didMove(toParentViewController: self)
|
|
}
|
|
}
|
|
|
|
|
|
- open override func viewWillAppear(_ animated: Bool) {
|
|
|
|
|
|
+ override func viewWillAppear(_ animated: Bool) {
|
|
super.viewWillAppear(animated)
|
|
super.viewWillAppear(animated)
|
|
isViewAppearing = true
|
|
isViewAppearing = true
|
|
childViewControllers.forEach { $0.beginAppearanceTransition(true, animated: animated) }
|
|
childViewControllers.forEach { $0.beginAppearanceTransition(true, animated: animated) }
|
|
}
|
|
}
|
|
|
|
|
|
- open override func viewDidAppear(_ animated: Bool) {
|
|
|
|
|
|
+ override func viewDidAppear(_ animated: Bool) {
|
|
super.viewDidAppear(animated)
|
|
super.viewDidAppear(animated)
|
|
lastSize = containerView.bounds.size
|
|
lastSize = containerView.bounds.size
|
|
updateIfNeeded()
|
|
updateIfNeeded()
|
|
@@ -99,22 +99,22 @@ class PagerTabStripViewController: UIViewController, UIScrollViewDelegate {
|
|
childViewControllers.forEach { $0.endAppearanceTransition() }
|
|
childViewControllers.forEach { $0.endAppearanceTransition() }
|
|
}
|
|
}
|
|
|
|
|
|
- open override func viewWillDisappear(_ animated: Bool) {
|
|
|
|
|
|
+ override func viewWillDisappear(_ animated: Bool) {
|
|
super.viewWillDisappear(animated)
|
|
super.viewWillDisappear(animated)
|
|
childViewControllers.forEach { $0.beginAppearanceTransition(false, animated: animated) }
|
|
childViewControllers.forEach { $0.beginAppearanceTransition(false, animated: animated) }
|
|
}
|
|
}
|
|
|
|
|
|
- open override func viewDidDisappear(_ animated: Bool) {
|
|
|
|
|
|
+ override func viewDidDisappear(_ animated: Bool) {
|
|
super.viewDidDisappear(animated)
|
|
super.viewDidDisappear(animated)
|
|
childViewControllers.forEach { $0.endAppearanceTransition() }
|
|
childViewControllers.forEach { $0.endAppearanceTransition() }
|
|
}
|
|
}
|
|
|
|
|
|
- open override func viewDidLayoutSubviews() {
|
|
|
|
|
|
+ override func viewDidLayoutSubviews() {
|
|
super.viewDidLayoutSubviews()
|
|
super.viewDidLayoutSubviews()
|
|
updateIfNeeded()
|
|
updateIfNeeded()
|
|
}
|
|
}
|
|
|
|
|
|
- open override var shouldAutomaticallyForwardAppearanceMethods: Bool {
|
|
|
|
|
|
+ override var shouldAutomaticallyForwardAppearanceMethods: Bool {
|
|
return false
|
|
return false
|
|
}
|
|
}
|
|
|
|
|
|
@@ -273,20 +273,20 @@ class PagerTabStripViewController: UIViewController, UIScrollViewDelegate {
|
|
|
|
|
|
// MARK: - UIScrollViewDelegate
|
|
// MARK: - UIScrollViewDelegate
|
|
|
|
|
|
- public func scrollViewDidScroll(_ scrollView: UIScrollView) {
|
|
|
|
|
|
+ func scrollViewDidScroll(_ scrollView: UIScrollView) {
|
|
if containerView == scrollView {
|
|
if containerView == scrollView {
|
|
updateContent()
|
|
updateContent()
|
|
lastContentOffset = scrollView.contentOffset.x
|
|
lastContentOffset = scrollView.contentOffset.x
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- public func scrollViewWillBeginDragging(_ scrollView: UIScrollView) {
|
|
|
|
|
|
+ func scrollViewWillBeginDragging(_ scrollView: UIScrollView) {
|
|
if containerView == scrollView {
|
|
if containerView == scrollView {
|
|
lastPageNumber = pageFor(contentOffset: scrollView.contentOffset.x)
|
|
lastPageNumber = pageFor(contentOffset: scrollView.contentOffset.x)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- public func scrollViewDidEndScrollingAnimation(_ scrollView: UIScrollView) {
|
|
|
|
|
|
+ func scrollViewDidEndScrollingAnimation(_ scrollView: UIScrollView) {
|
|
if containerView == scrollView {
|
|
if containerView == scrollView {
|
|
pagerTabStripChildViewControllersForScrolling = nil
|
|
pagerTabStripChildViewControllersForScrolling = nil
|
|
(navigationController?.view ?? view).isUserInteractionEnabled = true
|
|
(navigationController?.view ?? view).isUserInteractionEnabled = true
|
|
@@ -296,7 +296,7 @@ class PagerTabStripViewController: UIViewController, UIScrollViewDelegate {
|
|
|
|
|
|
// MARK: - Orientation
|
|
// MARK: - Orientation
|
|
|
|
|
|
- open override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
|
|
|
|
|
|
+ override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
|
|
super.viewWillTransition(to: size, with: coordinator)
|
|
super.viewWillTransition(to: size, with: coordinator)
|
|
isViewRotating = true
|
|
isViewRotating = true
|
|
pageBeforeRotate = currentIndex
|
|
pageBeforeRotate = currentIndex
|