How to check the button is pressed (pressed) or not?

Do I need to know the state of the button at this time, if I click or not?

thank

+3
source share
2 answers
if (myButton.state & UIControlStateHighlighted) {
   // Do your stuff the user is currently holding down her fingerโ€ฆ
}
0
source

take a look at the state property of your UIButton. You are interested in UIControlStateHighlighted.

0
source

Source: https://habr.com/ru/post/1775416/


All Articles