Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to limit switching between tabs only through the menu items? #89

Closed
TonyPNguyen opened this issue Dec 13, 2017 · 6 comments

Comments

@TonyPNguyen
Copy link

in other words, users can only switch between pagesthrough clicking on the tabs and not being able to switch in any other way (athough only other way I know right now is swiping between the pages themselves)

@rechsteiner
Copy link
Owner

Hi! Yes, you can disable user interaction on the page view controller like this:

pagingViewController.pageViewController.view.isUserInteractionEnabled = false

@TonyPNguyen
Copy link
Author

TonyPNguyen commented Dec 13, 2017

It works but the view controller its showing can't interact with the user anymore. Any ideas what I could do?

@rechsteiner
Copy link
Owner

Oh yeah that's true. Disabling scrolling on the scroll view should work:

pagingViewController.pageViewController.scrollView.isScrollEnabled = false

@TonyPNguyen
Copy link
Author

works like a charm! thanks for the speedy reply as always

@rechsteiner
Copy link
Owner

No problem 🙂

@tikipatel
Copy link

Updating to reflect a better answer found in #178:

pagingViewController.contentInteraction = .none

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants