Triggering a UIButton's method when user drags finger into button's area?

前端 未结 3 2099
南方客
南方客 2021-01-18 12:46

I want to have a button that triggers its method under the following conditions:

  • When the user taps the button
  • When the user presses the button and dr
3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-18 13:42

    Make you method such as -(IBAction)btnTap and connect to these properties

    • When the user taps the button. - Use Touch Down method for this
    • When the user presses the button and drags his/her finger out of the button's area - Use Touch Up Inside for this purpose
    • When the user drags his/her finger from outside the button's area to inside the button's - Touch Drag Inside

提交回复
热议问题