Slide through view controllers but not with the UISwipeGestureRecognizer
-
27-05-2021 - |
Question
Here is my issue, i got 5 view controllers and i can switch between them trough swipe with the UISwipeGestureRecognizer class and xcode's storyboard.
So this works, but, i dont like the slide effect. I like to make it in a way so you can exactly slide the view to another by dragging it.
Can anyone send me in the right direction? I searched on the internet but i cant find any functions or tutorial on how to do this.
Thanks in advance!
Edit: Im not looking the scroll view. Because this will result in some white spaces when i have 3 slides vertical for slide 1 and 5 slides vertical for slide 2. Hope u guys can follow me!
Edit: This is what i try to accomplish. **
Solution
I think you can use UIScrollView
for your purposes. Check this Apple's sample code.
UPDATE:
Here is sample project that you need. I think it will be helpful. Sorry for naming - first use of github.
How it works:
- Creating root UIScrollView
with set of "Root slides"
- Each "Root slide" has UIScrollView
with View
s that scrolls vertically
- Added check - we can scroll horizontally only from "Root slide"
OTHER TIPS
Use a UIPanGestureRecognizer
instead and start the transition, if it was panned long enough.
Also you could try to use one paged ScrollView for each vertical slide and put them all together in a paged horicontal scrollview.