0

I need to create a right side swipe menu in one of the child views like the one in facebook app. I have referred to sample codes like Inferis/ViewDeck.

But my issue is that i want to implement the side swipe on lets say Y view controller. In app delegate, initially X viewcontroller is set. At that time in X viewcontroller, i have set Z viewcontroller as hidden in background. Then when i click on X view's one button, Z viewcontroller is displayed. And from Z viewcontroller I want to perform swipe to open/close to Y viewcontroller.

Any hint would be greatly appreciated.

Shaunak
  • 707
  • 1
  • 9
  • 29

1 Answers1

0

The trick here is the z-index.

You have a view that the user is viewing (View A). Behind that could be another view that's waiting to be revealed (View B). Clicking a button on View A, or perhaps swiping across View A, would cause it to animate to the right -- revealing View B waiting below. Finish your work with View B, then you slide View A back in to place.

This same idea could be used to review multiple levels of views. View B could slide to reveal View C, and so on.

Axeva
  • 4,697
  • 6
  • 40
  • 64
  • No, but the concept of z-index still exists. A view higher up in the stacking order will cover those below it. – Axeva Jan 09 '13 at 17:08
  • True, I am just unsure if 'z-index' is the right word in this context. – Björn Kaiser Jan 09 '13 at 17:10
  • z-space? View hierarchy? View stacking? Take your pick. – Axeva Jan 09 '13 at 20:01
  • @Axeva: Nice suggestion, but i want to control swipe gesture only on View B->C. ViewA->B swipe is not required. Also when I use ViewDeck (https://github.com/Inferis/ViewDeck) sample library, i am unable to perform this feature from View B, since ViewB's parent view would be VIew A, and in ViewDeck i have to assign ViewB as parent(center view) and View C as its right view. – Shaunak Jan 09 '13 at 21:27
  • I'm not familiar with ViewDeck, but this can totally be done in plain-vanilla Cocoa Touch. View A is the main view in your View Controller. View B gets added when needed, with View C underneath it. Then just slide View B to the side when you want to reveal View C. – Axeva Jan 10 '13 at 13:59