Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Workaround for missing UIBarButtonItem's TouchUp event

using a UIButton allows me to catch TouchUpInside and TouchUpOutside events to know when the user releases the button with his finger.

UIBarButtonItem doesn't have any events/notifications to be used in this manner.

Does anyone know a nice workaround to know when a UIBarButtonItem is physically released? Is there a way to use an UIButton in a UIToolBar with the same "design" and behavior like a UIBarButtonItem?

Thanks!

like image 559
Boris Avatar asked Jul 30 '10 08:07

Boris


1 Answers

    IBOutlet UIBarButtonItem *barButton;
....


- (void)viewDidLoad
{
  barButton.action = @selector(onBarButtonTap);

....

- (IBAction)onBarButtonTap
{
  NSLog( @"BarButton Taped" );
}
like image 177
Alex Koff Avatar answered Oct 23 '22 13:10

Alex Koff