iPhone App: implementation of Drag and drop images in UIView

后端 未结 6 724
伪装坚强ぢ
伪装坚强ぢ 2020-12-04 18:49

In my iPhone App I want to implemented functionality as shown below

\"enter

6条回答
  •  遥遥无期
    2020-12-04 19:15

    Easiest way is to use a UIPanGestureRecognizer. That will give you messages when the view is moved and when it is dropped. When it is moved, update its center. When it is dropped, check if its position is within the bounds of the view you want to drop in. (You might need to convert coordinates to the target view's coordinate system.) If it is, do the appropriate action.

提交回复
热议问题