I create a left button element with the following method:
- (void)leftButtonOnNavigationItem:(NSString *)imageName type:(NSInteger)type { UIImage *backImg = [UIImage imageNamed:imageName]; UIButton *backBtn = [[UIButton alloc] initWithFrame:CGRectMake(0.f, 0.f, backImg.size.width, backImg.size.height)]; if (type == 0) [backBtn addTarget:self.navigationController action:@selector(pop) forControlEvents:UIControlEventTouchUpInside]; else [backBtn addTarget:self action:@selector(leftMake) forControlEvents:UIControlEventTouchUpInside]; backBtn.contentMode = UIViewContentModeCenter; [backBtn setImage:backImg forState:UIControlStateNormal]; UIView *backBtnView = [[UIView alloc] initWithFrame:backBtn.bounds]; backBtnView.bounds = CGRectOffset(backBtnView.bounds, -6, 0); [backBtnView addSubview:backBtn]; UIBarButtonItem *backBarBtn = [[UIBarButtonItem alloc] initWithCustomView:backBtnView]; self.navigationItem.leftBarButtonItem = backBarBtn; }
I need to add a button on the View, because when I use CGRectOffset for the button, it does not work. So, in this case, my button on one of the UIViewController showed

So this is what I want. But the UIBarButton only started clicking on the UIBarButton (rectangle area). But when I add only the button to the UIBarButtonItem, it works even if I click on the UINavigationBar area that you can see on the screen.
I add a button like this:
- (void)leftButtonOnNavigationItem:(NSString *)imageName type:(NSInteger)type { UIImage *backImg = [UIImage imageNamed:imageName]; UIButton *backBtn = [[UIButton alloc] initWithFrame:CGRectMake(0.f, 0.f, backImg.size.width, backImg.size.height)]; if (type == 0) [backBtn addTarget:self.navigationController action:@selector(pop) forControlEvents:UIControlEventTouchUpInside]; else [backBtn addTarget:self action:@selector(leftMake) forControlEvents:UIControlEventTouchUpInside]; backBtn.contentMode = UIViewContentModeCenter; [backBtn setImage:backImg forState:UIControlStateNormal];
and now my button is shown as follows

So, CGRectOffset does not work, and my UIBarButton is very close to the left side of the screen, but it works fine by touching the entire area on the navigation bar that you see on the screen. Therefore, I can touch all areas in the navigation bar, and UIBarButton will work fine
I need: UIBarButton should be displayed as in the first case with a larger area on the left side. But it should work by pressing not only the button, but also all the surrounding sounds, as in the second case. What should I do?
EDIT In the first case, the button is pressed if I touch the next area

In the second case, the button is pressed if I touch the next area

I need the button position, as in the first case (more origin.x on the left side), but the clickable area, as in the second case