Skip to content

Instantly share code, notes, and snippets.

@samrayner
Created February 27, 2014 15:27
Show Gist options
  • Select an option

  • Save samrayner/9252281 to your computer and use it in GitHub Desktop.

Select an option

Save samrayner/9252281 to your computer and use it in GitHub Desktop.
- (void)displayError:(NSError *)error
{
[self displayAlertWithTitle:@"Error" message:[error description]];
}
- (void)displayAlertWithTitle:(NSString *)title message:(NSString *)message
{
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:title
message:message
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alertView show];
}
- (void)displayPromptWithTitle:(NSString *)title message:(NSString *)message placeholder:(NSString *)placeholder
{
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:title
message:message
delegate:self
cancelButtonTitle:@"Cancel"
otherButtonTitles:@"OK", nil];
alertView.alertViewStyle = UIAlertViewStylePlainTextInput;
[alertView textFieldAtIndex:0].text = placeholder;
[alertView show];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment