Reputation: 121
I had a x uiview of(366 108) and another uiview On the top of X Uiview with with (370,340) on the initial page loading of the view controller the X Uiview will appear on the swipe of that uiview I need to hide the X uiview and show Y uiview and Vice versa
Upvotes: 1
Views: 2119
Reputation: 14477
You can achieve this by couple of ways
UIScrollView
and add both views in scrollView horizontally stack, now set the contentSize
of scrollView, also set enablePaging = YES
Or you can use UIPageViewController
and add as many pages as you want and it will show one page at time. Here is tutorial which you can use for getting started
else use swipeGesture
for directions left/right based on condition hide and show your UIView
Also read Apple docs for UIPageViewController and UISCrollView
Upvotes: 3