I am not getting the behavior I expect out of a text field. Previously, I have instantiated textFields via storyboard or Xib. When I click within the textfields bounds it becomes first responder and when I click outside it resigns first responder.
This isn't the case when I create it programmatically within this void method. I tried emulating the behavior by setting textfield to first responder with a uiTextFieldDelegate method but not actually fire when clicking in the textfield.
- (void)createTextField {
self.searchField = [[UITextField alloc] initWithFrame:CGRectMake(25, 25, 250, 35)];
self.searchField.delegate = self;
//[self.searchField becomeFirstResponder];
[self.mapView addSubview:self.searchField];
self.searchField.borderStyle = UITextBorderStyleRoundedRect;
self.searchField.placeholder = @"type here";
self.searchField.backgroundColor = [UIColor redColor];
self.searchField.userInteractionEnabled = YES;
self.searchField.clipsToBounds = YES;
}