title: Restrict clickable area of leftbarbuttonitem to the size of custom uibarbuttonitem
body: <p>I have implemented a SWReveal control on my app. To triger the action I have a UIBarButtonItem with a custom view. Well, everything is working fine, but I have noticed that I can fire the event even when clicking far away from the image (image of about 44px wide...and clicking up to 100px).</p>
  
  <p>I have been searching for a while, and the best solution that I ve found (defining a custom button and instantiating a UIBarButtonItem with "initWithCustomView")</p>
  
  <p>This is my previous code:</p>
  
  <pre><code>UIBarButtonItem *revealButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"reveal-icon"] style:UIBarButtonItemStylePlain target:_revealController action:@selector(revealToggle:)];
  self.navigationItem.leftBarButtonItem = revealButtonItem;
  </code></pre>
  
  <p>And the code with the "solution":</p>
  
  <pre><code>//create the image for your button, and set the frame for its size
  UIImage *image = [UIImage imageNamed:@"reveal-icon"];
  CGRect frame = CGRectMake(0, 0, image.size.width, image.size.height);
  //init a normal UIButton using that image
  UIButton* button = [[UIButton alloc] initWithFrame:frame];
  [button setBackgroundImage:image forState:UIControlStateNormal];
  [button addTarget:_revealController action:@selector(revealToggle:) forControlEvents:UIControlEventTouchUpInside];
  //finally, create your UIBarButtonItem using that button
  UIBarButtonItem* revealButtonItem = [[UIBarButtonItem alloc] initWithCustomView:button];
  
  self.navigationItem.leftBarButtonItem = revealButtonItem;
  </code></pre>
  
  <p>With this later code I know I have a correct sized button (I ve set backgroundColor, and checked the correct size of the button), but still firing the action when tapping far away from the button.</p>
  
  <p>¿any ideas?</p>
  
  <p>Thank you in advance.</p>