Only disable user interaction when animating

This commit is contained in:
Raphael Köhler 2016-10-01 15:34:16 +02:00
parent d12b4fa6c5
commit e00a90b671
1 changed files with 2 additions and 2 deletions

View File

@ -138,11 +138,11 @@ open class PagerTabStripViewController: UIViewController, UIScrollViewDelegate {
tmpViewControllers[fromIndex] = currentChildVC
pagerTabStripChildViewControllersForScrolling = tmpViewControllers
containerView.setContentOffset(CGPoint(x: pageOffsetForChild(at: fromIndex), y: 0), animated: false)
(navigationController?.view ?? view).isUserInteractionEnabled = false
(navigationController?.view ?? view).isUserInteractionEnabled = !animated
containerView.setContentOffset(CGPoint(x: pageOffsetForChild(at: index), y: 0), animated: true)
}
else {
(navigationController?.view ?? view).isUserInteractionEnabled = false
(navigationController?.view ?? view).isUserInteractionEnabled = !animated
containerView.setContentOffset(CGPoint(x: pageOffsetForChild(at: index), y: 0), animated: animated)
}
}