Im creating an app and one part of it has a tap counter in it.
The UI consists of a button which is pressed for counting, a reset button and a label which displays the amount of taps. The problem is that I want the iDevice to vibrate or make a sound after a specific amount of taps and then end there so the counter label doesn't react to the button anymore.
Here is my code so far:
.h
@interface TapsViewController : UIViewController {
int counter;
IBOutlet UILabel *count;
}
-(IBAction)plus;
-(IBAction)reset;
@end
.m
- (void)viewDidLoad {
counter=0;
count.text = @"Start";
}
-(IBAction)plus{
counter=counter + 1;
count.text = [NSString stringWithFormat:@"%i", counter];
}
-(IBAction)reset{
counter=0;
count.text = [NSString stringWithFormat:@"Start"];
}
How do I have the app vibrate or make a sound when the counter reaches a predetermined value?
Thank you for your help!