0

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?

arnoapp
  • 2,416
  • 4
  • 38
  • 70

2 Answers2

5

Use another event - UIControlEventTouchUpInside for example

[inButton addTarget:self action:@selector(cardTouchUp) forControlEvents:UIControlEventTouchUpInside];
beryllium
  • 29,669
  • 15
  • 106
  • 125
  • Okay I asked the wrong question. I recognized that I want to perform a action when the button is highlighted and perform another action when he leaves the highlighted state... Another advice? Sorry I think your answers is 100% correct. – arnoapp Apr 01 '12 at 20:47
0

You mean like UIControlEventTouchUpInside ?

You can find all UIControll Everts Here (See Constants)

Justin
  • 2,960
  • 2
  • 34
  • 48