iOS 警告窗口

- (IBAction)buttonPressed:(id)sender {
    
    NSDate *date=self.datePicker.date;
    NSString *message=[[NSString alloc]initWithFormat:@"The date and time you select is %@",date];
    UIAlertController *alert=[UIAlertController alertControllerWithTitle:@"Date and Time selected" message:message preferredStyle:UIAlertControllerStyleAlert];
    UIAlertAction *action=[UIAlertAction actionWithTitle:@"That's so true!" style:UIAlertActionStyleDefault handler:nil];
    
    [alert addAction:action];
    [self presentViewController:alert animated:YES completion:nil];
}

活活累死, 比安卓负责两万倍, 安卓烤土司, 多好...

原文地址:https://www.cnblogs.com/Montauk/p/5556480.html