PDA

View Full Version : Help with making a button




MrPenguin9
Nov 20, 2008, 10:06 PM
How do you tell it during the button is held down do this, and when you let go of the button do this?

Thanks so much



jnic
Nov 21, 2008, 03:51 AM
In Interface Builder add a couple of IBActions for (respectively) Touch Down and Touch Up Inside.

Niiro13
Nov 21, 2008, 12:42 PM
And if you want to do it programatically, then you'd go

[myButton addTarget:self action:@selector(touchDownAction:) forControlEvents:UIControlEventTouchDown];
[myButton addTarget:self action:@selector(touchUpAction:) forControlEvents:UIControlEventTouchUpInside];

MrPenguin9
Nov 21, 2008, 09:22 PM
Thanks for your help!:)