Open Attiv opened 7 years ago
I'm looking for the same functionality. I've tried editing various lines of OnboardingViewController.m to dismiss the view controller to no avail. To be clear, I would like to make it so if the user is on the last page and swipes, the onboarding closes.
@willc0de4food I used these:
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
if ((self.pageControl.currentPage == (self.pageControl.numberOfPages - 1 )) && (fabs(scrollView.contentOffset.x - self.view.frame.size.width) / self.view.frame.size.width) > 0.15 ){
if (self.skipHandler) {
self.skipHandler();
}
}
}
Swift subclass of OnboardingViewController to implement this:
class MyOnboardingViewController: OnboardingViewController {
override func scrollViewDidScroll(_ scrollView: UIScrollView) {
if (pageControl.currentPage == (pageControl.numberOfPages - 1)) && (fabs(scrollView.contentOffset.x - view.frame.size.width) / view.frame.size.width) > 0.15 {
if skipHandler != nil {
skipHandler()
}
}
}
}
Don't clicked the skip button.