Xcode iOS push down button and drag then up on a second button

后端 未结 5 1418
悲&欢浪女
悲&欢浪女 2021-01-15 20:06

Lets say I wan\'t to add 1 to an integer. This will only be done when I push down on a UIButton and then release my finger on another UIButton.

5条回答
  •  清酒与你
    2021-01-15 20:26

    Another approach is to use a UITapGestureRecognizer and UIPanGestureRecognizer and track the location in your buttons. I found this to be more readable. (I actually ended up using UILabels because I didn't need any further UIButton behavior.)

提交回复
热议问题