zoukankan      html  css  js  c++  java
  • UIAlertController简单使用

    UIAlertView   在iOS2 的时候开始使用,在iOS9 的时候被摒弃

    NS_CLASS_DEPRECATED_IOS(2_0, 9_0, "UIAlertView is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleAlert instead") __TVOS_PROHIBITED

    由UIAlertController替代

    常用使用方法

        UIAlertController *alertvc = [UIAlertController alertControllerWithTitle:@"提示" message:@"表视图封装" preferredStyle:UIAlertControllerStyleAlert];
        UIAlertAction *sureAction = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
            //要执行的操作
        }];
        [alertvc addAction:sureAction];
        UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"取消"style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
            //要执行的操作
            
        }];
        [alertvc addAction:cancelAction];
        
        [self  presentViewController:alertvc animated:YES completion:nil];
  • 相关阅读:
    HDOJ 1846 Brave Game
    并查集模板
    HDU 2102 A计划
    POJ 1426 Find The Multiple
    POJ 3278 Catch That Cow
    POJ 1321 棋盘问题
    CF 999 C.Alphabetic Removals
    CF 999 B. Reversing Encryption
    string的基础用法
    51nod 1267 4个数和为0
  • 原文地址:https://www.cnblogs.com/OIMM/p/9288624.html
Copyright © 2011-2022 走看看