I am creating a barbuttonitem with the following code and i am adding a gesture recognizer to the navigation bar. So i need to know when the user tapped on the left or right of the barbuttonitem by 25 pixels. Is this possible using the gesture recognizer? Any help appreciated...
UIButton *searchButton = [self createSearchButton];
UITapGestureRecognizer *gr = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleGestureForTopLeftNotificationBarButtonItem:)];
[self.navigationController.navigationBar addGestureRecognizer:gr];
- (UIButton *) createSearchButton {
UIButton *searchButton = [UIButton buttonWithType:UIButtonTypeCustom];
[searchButton setImage:[UIImage sdk_imageName:@"Search_header_black"]
forState:UIControlStateNormal];
[searchButton addTarget:self action:@selector(searchBarButtonClick) forControlEvents:UIControlEventTouchUpInside];
searchButton.size = CGSizeMake(32, 30);
searchButton.imageEdgeInsets = UIEdgeInsetsMake( 0, 8, 0, 0);
return searchButton;
}