Skip to content

Instantly share code, notes, and snippets.

@gdavis
Created October 1, 2012 18:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gdavis/3813665 to your computer and use it in GitHub Desktop.
Save gdavis/3813665 to your computer and use it in GitHub Desktop.
Display popover for textfield
- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField
{
// prevent the start date from manually entering text.
// instead, we display a popover with a date picker
if (textField == self.startDateField && self.popover == nil) {
[self.view endEditing:NO];
[self presentDatePickerFromField:textField pickerID:nil];
return NO;
}
return YES;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment