Implementing side-swipe menu like facebook from the parent view which also has different hidden subviews

StackOverflow https://stackoverflow.com/questions/14238786

  •  14-01-2022
  •  | 
  •  

Question

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.

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top