Nimrod Shai
Nimrod Shai

Reputation: 1179

Deactivating a UIButton

When I click a button for more than half a second, the button turns blue (being activated). Then, if I drag my touch out side the button, it is still activated and if i release my touch it activates my action.

How can I deactivate a UIButton when dragging outside?

Thanks.

Upvotes: 1

Views: 53

Answers (1)

mmc
mmc

Reputation: 17414

The event you have wired up to the UIButton should be "touchUpInside"

This will have the behavior you desire.

Upvotes: 4

Related Questions