Alex Rivera | Logout

IOS drag, flick, or fling a UIView

Asked 2011-07-07T16:30:05.443
14

Was wondering how I would go about flicking or flinging a UIView, such as http://www.cardflick.co/ or https://squareup.com/cardcase demo videos.

I know how to drag items, but how do you give them gravity/inertia. Is this handled by IOS?

Edit
Report

1 Answer

0

There's nothing built into iOS that does this for you, but you could easily implement it yourself. I'd start by creating a gesture recognizer that recognizes the "flick" gesture that you want to use, possibly something that looks for constant direction and increase in velocity. When you recognize such a gesture, you just have to animate the affected view's position appropriately.

answered 2011-07-07T16:32:46.507

Your Answer