title: Why UIBarButtonItem not getting clicks in UIToolbar set as inputAccessoryView of UITextField?
body: <p><strong>UIBarItem does not respond to clicks inside UIToolbar which is setup as inputAccessoryView on a UITextField.</strong></p>
  
  <p>The button does not show click animation when I try to click it, callback does not get called.
  My setup looks like:</p>
  
  <pre><code>@interface MyViewController()
  @property (weak, nonatomic) IBOutlet UITextField *closeDateTextField;
  @property (strong, nonatomic) UIToolbar * datePickerToolbar;
  @end
  </code></pre>
  
  <p>I setup toolbar with button:</p>
  
  <pre><code>- (void)viewDidLoad {
  
      self.datePickerToolbar = [[UIToolbar alloc] init];
      UIBarButtonItem * doneBtn =
          [[UIBarButtonItem alloc]
                  initWithBarButtonSystemItem:UIBarButtonSystemItemDone
                  target:self
                  action:@selector(hidePicker:)];
  </code></pre>
  
  <p>add button to toolbar and set toolbar as <code>inputAccessoryView</code> of <code>UITextField</code>:</p>
  
  <pre><code>    [self.datePickerToolbar setItems:@[doneBtn] animated:NO];
      self.closeDateTextField.inputAccessoryView = self.datePickerToolbar;
  }
  </code></pre>
  
  <p>When I click on <code>closeDateTextField</code> the keyboard appears with a <code>Done</code> button in toolbar but the button does not respond to click, the <code>hidePicker:</code> does not get called.</p>
  
  <pre><code>- (void)hidePicker:(id)sender {
      [self.closeDateTextField resignFirstResponder];
  }
  </code></pre>
  
  <p>Any idea what I'm doing wrong?</p>