user5276912
user5276912

Reputation: 121

Horizontal swipe between two views

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

Answers (1)

Adnan Aftab
Adnan Aftab

Reputation: 14477

You can achieve this by couple of ways

  1. Use a UIScrollView and add both views in scrollView horizontally stack, now set the contentSize of scrollView, also set enablePaging = YES
  2. 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

  3. 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

Related Questions