1

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?

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Telepresence
  • 619
  • 2
  • 7
  • 22

1 Answers1

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

Community
  • 1
  • 1
Rahul
  • 5,594
  • 7
  • 38
  • 92