The button in my iOS app is highlighted programmatically on receiving a certain message. I want to keep the button highlighted only for specified time duration (approximately 5 seconds). Is there a way to do it in Objective-C?
Asked
Active
Viewed 282 times
1
-
what exactly you mean by highlight? u change color or you mean default highlight state of uibutton? – Fahim Parkar Nov 30 '16 at 05:06
-
Update your question with relevant code you have so far. Clearly explain what it is you wish to accomplish. – rmaddy Nov 30 '16 at 05:08
1 Answers
3
Their is not direct way to control UIButton highlighted state duration.
Although you can do it very easily.
Just change the background color or set Image for UIButton.
And using this method:
[self performSelector:@selector(removeHighlightedState) withObject:nil afterDelay:5.0];
and in removeHighlightedState set you UIButton to original state.
For more Reference