Skip to content

Instantly share code, notes, and snippets.

@RyanBreaker
Created October 31, 2014 08:04
Show Gist options
  • Select an option

  • Save RyanBreaker/592532a5e6bd6d69cb81 to your computer and use it in GitHub Desktop.

Select an option

Save RyanBreaker/592532a5e6bd6d69cb81 to your computer and use it in GitHub Desktop.
- (IBAction)displayDay:(id)sender {
NSDate *chosen = [self.datePicker date];
NSDateFormatter *formatter = [[NSDateFormatter alloc]init];
[formatter setDateFormat:@"EEEE"];
NSString *day = [formatter stringFromDate:chosen];
NSString *msg = [[NSString alloc] initWithFormat:@"That's a %@.", day];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"What day is that?"
message:msg
delegate:nil
cancelButtonTitle:@"Okay"
otherButtonTitles:nil, nil];
[alert show];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment