IOS drag, flick, or fling a UIView

前端 未结 3 671
暗喜
暗喜 2020-12-23 02:17

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 i

3条回答
  •  猫巷女王i
    2020-12-23 03:15

    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.

提交回复
热议问题