UIAlertController的使用二

UIAlertController *actionSheetController = [UIAlertController alertControllerWithTitle:@"action选项" message:nil preferredStyle:UIAlertControllerStyleActionSheet];

        UIAlertAction *action0 = [UIAlertAction actionWithTitle:@"选项一" style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {

            [self customMethod1];

                                                        }];

        [actionSheetController addAction:action0];

        

        UIAlertAction *action = [UIAlertAction actionWithTitle:@"选项二" style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {

        [self <span style="font-family: Arial, Helvetica, sans-serif;">customMethod2</span>];

                                                       }];

        UIAlertAction *action1 = [UIAlertAction actionWithTitle:@"选项三" style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {

            

            [self customMethod3];

                                                        }];

        UIAlertAction *actionCancel = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction * action) {}];

        

        [actionSheetController addAction:action];

        [actionSheetController addAction:action1];

        [actionSheetController addAction:actionCancel];

        [actionSheetController.view setTintColor:[UIColor greenColor]];

        [self presentViewController:actionSheetController animated:YES completion:nil];

你可能感兴趣的:(UIAlertController的使用二)