0

I'm trying to make a swipe navigation but i block on one point.. I must to create several views with one viewcontroller that controls them for swiping ? Or I must to create one view with one viewcontroller each time ?

Thx you

Marc Lamberti
  • 763
  • 2
  • 9
  • 24

1 Answers1

0

Depends.
1, You can either have multiple viewControllers embedded in a single UINavigationController and use a UISwipeGestureRecognizer and a Segue on every viewController to travel between them hierarchically....

2, ... or you could use one single viewController with multiple UIViews and a UIPageControl (like in the default Weather app). You can find examples here and here.

The second option will give you smoother scrolling experience, but for showing entire different viewControllers i think you have to use the firsts option.

There is also the matter of transferring data between the views/viewControllers. In the first option you should use Segues and delegate protocols to transfer data between viewControllers.

Community
  • 1
  • 1
Zoltán Matók
  • 3,923
  • 2
  • 33
  • 64