iOS UIAlertController

UIAlertController *actionSheet = [UIAlertController alertControllerWithTitle:@"确定要退出登录吗?" message:nil preferredStyle:UIAlertControllerStyleActionSheet];

    UIAlertAction *alertT = [UIAlertAction actionWithTitle:@"退出登录" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {

        NSLog(@"点击退出登录");

    }];

    UIAlertAction *alertF = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {

        NSLog(@"点击了取消");

    }];


    [actionSheet addAction:alertT];

    [actionSheet addAction:alertF];

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

你可能感兴趣的:(iOS UIAlertController)