I'l like for one of the buttons in my navigation bar to have a different action on longpress. If it were a normal button, I'd just add the gesture recognizer to its view, but a BarButton doesn't have one.
Clues?
I'l like for one of the buttons in my navigation bar to have a different action on longpress. If it were a normal button, I'd just add the gesture recognizer to its view, but a BarButton doesn't have one.
Clues?
It's Painful process to add sub-view your gesture in UIBarButtonItem item. I show you in following code. It may help you.
I like to suggest you that instead of groping around for a subview you can create the button on your own and add a button bar item with a custom view
[[[yourToolbar subviews] objectAtIndex:[[yourToolbar items] indexOfObject:yourBarButton]] addGestureRecognizer:YourGesture];
// or also you can also try following....
[self.barButtonItem.customView addGestureRecognizer:longProcess];// i didn't declare longProcess and singletap GestureRecognizer here. I hope you can do that.
[self.barButtonItem.customView addGestureRecognizer:singletap];
Hope, this will help you..