I have buttons and a selector for the buttons, the code looks like this:
[cell.secondColumnButton addTarget:self action:@selector(whichButtonDidMasterPressed:)
forControlEvents:UIControlEventTouchUpInside];
[cell.secondColumnButton addTarget:self action:@selector(moreResponsiveButtons:)
forControlEvents:UIControlEventTouchDown];
Right now I have this in the “moreResponsive” selector:
-(void)moreResponsiveButtons:(UIButton*)sender{
NSLog(@"responsiveButton");
[sender setAlpha:0.5];
[sender setBackgroundColor:[UIColor lightGrayColor]];
}
The button is invisible when it’s in a normal state, but I want to change the state to have feedback when the user taps it.
So the question is two-fold, which forControlEvents should I use?
And what code should I put in the selector?
The button i quite big, 250 x 175 points.
How user knows where to tap a button if it is hidden?
Try using UIControlEventTouchUpInside like this:
EDIT
You can set title on button before touch and it won’t be visible cos button is hidden. After touch you just set hidden to NO and voila. Button is shown with text inside.