iOS

iOS被替换的方法及其更新方法

2017-08-18  本文已影响29人  清都

弹窗


- (IBAction)doClick:(UIButton *)sender {
    
    
    UIAlertController * alertC = [UIAlertController alertControllerWithTitle:@"随便按" message:@"让你按你就按" preferredStyle:UIAlertControllerStyleActionSheet];
    
    UIAlertAction * action1 = [UIAlertAction actionWithTitle:@"选项1" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
        NSLog(@"click001");
    }];
    [alertC addAction:action1];
    
    UIAlertAction * action2 = [UIAlertAction actionWithTitle:@"选项2" style:(UIAlertActionStyleDefault) handler:^(UIAlertAction * _Nonnull action) {
        NSLog(@"click002");
    }];
    [alertC addAction:action2];
    
    UIAlertAction * action3 = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
        NSLog(@"取消");
    }];
    [alertC addAction:action3];
    
    [self presentViewController:alertC animated:YES completion:nil];
    
}
alert
上一篇 下一篇

猜你喜欢

热点阅读