Question

I am basically trying to design a swipe/drag gesture for the UITextView where it behaves a lot like the mail application. I want to swipe to the left and it will start to reveal the buttons behind it.

What's the best way to design this?

Does a UISwipeGesture give you any data on the current swipe distance, so I can either reveal it after a threshold?

Was it helpful?

Solution

The simplest approach is to put your view inside a UIScrollView and set up the content view to permit horizontal scrolling. Thus the user can now drag your entire view to the left. Meanwhile, the buttons are sitting in another view behind all of that. This is in fact how a lot of the iOS 7 interface does work. See also the WWDC 2013 video on scroll views.

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