I have made a view clickable with a tap gesture recognizer, which is working just fine. But I want to highlight the view when the touch happens en remove it when the touch ended.
I have tried this:
- (IBAction)refresh:(UITapGestureRecognizer *)sender {
if(self.currentStatus == NODATA){
if(sender.state == UIGestureRecognizerStateBegan){
NSLog(@"Began!");
[self.dashboardViewController.calendarContainer state:UIViewContainerStatusSELECTED];
}
if (sender.state == UIGestureRecognizerStateEnded){
NSLog(@"%@", @"Ended");
[self.dashboardViewController.calendarContainer state:UIViewContainerStatusNORMAL];
}
[self setState:REFRESHING data:nil];
}
}
The NSLog of "Ended does" get displayed but the began didn't so it never goes into selected. Why is this?