Open noramimiyuma opened 4 years ago
I can confirm this problem. However, I am not sure if this in intended behaviour or a bug?
Anyway, I was looking for a reliable way to get informed about page/ViewController changes. You can use the changeCurrentIndex
and changeCurrentIndexProgressive
to solve this. In my case changeCurrentIndexProgressive
was the best choice:
class MyPageViewController: ButtonBarPagerTabStripViewController {
// XLPagerTabStrip function: add ChildViewControllers
override func viewControllers(for pagerTabStripController: PagerTabStripViewController) -> [UIViewController] {
let child1VC = CustomViewController()
let child2VC = CustomViewController()
return [child1VC, child2VC]
}
func someMethodCalledDuringInit() {
changeCurrentIndexProgressive = { (oldCell, newCell, progressPercentage, changeCurrentIndex, animated) in
if progressPercentage >= 1 {
pring("Page switch complete")
}
}
}
}
Environment (version):
Description
moveToViewController(at index: Int, animated: Bool)
is called when tap tab items, but not called when swipe to change index. I think that this method has to be called when also swipe to change index. Or my operation has some wrongs?