arnoapp
arnoapp

Reputation: 2486

Perform Action when UIButton State changes

I have a UIButton that performs an Action when it is touched down. I do this with

[inButton addTarget:self action:@selector(cardTouchDown) forControlEvents:UIControlEventTouchDown];

Now I want to perform another action when the button leaves this state. Any advices how to do this?

Upvotes: 0

Views: 1955

Answers (2)

Justin
Justin

Reputation: 2999

You mean like UIControlEventTouchUpInside ?

You can find all UIControll Everts Here (See Constants)

Upvotes: 0

beryllium
beryllium

Reputation: 29767

Use another event - UIControlEventTouchUpInside for example

[inButton addTarget:self action:@selector(cardTouchUp) forControlEvents:UIControlEventTouchUpInside];

Upvotes: 5

Related Questions