I need like to keep a UIButton highlighted after a touch event. In iOS versions < 7 I used the following action for the Touch Up Inside event:
- (IBAction)clickMe:(id)sender {
UIButton *button = sender;
[NSOperationQueue.mainQueue addOperationWithBlock:^{ button.highlighted = YES; }];
}
Unfortunately something has changed in iOS 7 and this code doesn't work anymore: if I tap the button, the button reverts to normal state; interestingly, if I keep the button pressed for a little longer, the button remains highlighted. Please note that the app was developed for iOS 6 so it runs in iOS 7 in compatibility mode. I'm trying to figure out a way to make the app work properly on both iOS 6 & 7 but so far I haven't found a nice solution (one workaround is to queue an event that highlights the button after a short delay but that produces an annoying flickering of the button). Any advice?