在屏幕上移动按钮

在屏幕上移动按钮

问题描述:

我有一个 UIButton ,我想通过在屏幕上触摸和滑动来移动该按钮。当我释放触摸时,它将处于当前位置。

I have an UIButton and I want to move that button by touching and swiping it in the screen. When I release the touch it will be in the current position. Explain clearly, please.

检查

您应该从这些点开始移动框并相应地移动框,以便您的按钮可以移动到触摸的地方

you should make move frame from the points and move frame accordingly so that your button moves in places of touches