Hello all,
I am trying to make a button that response to single and double tap. I am trying to do this using myAction method. The problem is that first time when I press the button the method myAction isn't called.
Can somebody tell why this happening and how can I fix that?
-(IBAction)myButton:(id)sender{
UIButton *theButton = (UIButton *)sender;
[theButton addTarget:self action:@selector(myAction:forEvent:) forControlEvents:UIControlEventAllEvents];
}
- (void)myAction:(id)sender forEvent:(UIEvent *)event {
NSLog(@"Touch events goes here");
}
Thank you,
I. Vasilev