I have my application set up such that the user can swipe left or right to navigate between view controllers, similar to SnapChat. I implemented this using a UIScrollView
with paging enabled.
One feature from SnapChat I would also like to implement is the ability for the user to pick a cell in a tableview, begin to slide it over, and then have the cell "lock" after a certain point, allowing the user to be able to pull the entire view across the screen. This may be somewhat difficult to picture if you haven't ever used SnapChat, so I've included images of what I'm talking about:
How should I implement this feature using a UIScrollView?
Currently, one of the view controllers in my ScrollView has a UITableView
, with custom UITableViewCells
that contain gesture recognizers that allow them to slide over as they detect a swipe. Once the gesture recognizer detects a translation greater than a certain amount, the cell stops sliding relative to the view controller, and the entire scroll view starts to slide instead.
This roughly achieves the same effect as SnapChat, but it doesn't seem as nice and is very buggy. For example, if the user tries to flick the tableview cell (like people often do in SnapChat), s**t hits the fan.
SnapChat's implementation of the feature gives the impression that after sliding the cell a certain amount, the user "retains control" of the scroll view. It's a very elegant user experience, and I'm not sure how to go about replicating it.
If there is any additional helpful information I should provide (such as my code so far), let me know.