CYiOSer / UIAlertController-block

UIAlertController 封装为工具类,通过 block,一句代码调用

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

UIAlertController-block

UIAlertController 封装为工具类,通过 block,一句代码调用

introduction (先导入 JHSysAlertUtil.h)

    /** 单按键 */
    [JHSysAlertUtil presentAlertViewWithTitle:@"标题" message:@"This a message" confirmTitle:@"确定" handler:^{
        NSLog(@"@@  This is just a log O(∩_∩)O~ @@");
    }];
    
    /** 双按键 */
    [JHSysAlertUtil presentAlertViewWithTitle:@"标题" message:@"This is message" cancelTitle:@"取消" defaultTitle:@"确认" distinct: YES cancel:^{
        NSLog(@"@@~ 取消 ~@@");
    } confirm:^{
        NSLog(@"@@~ 确认 ~@@");
    }];
    
    /** Alert  任意多个按键 返回选中的 buttonIndex 和 buttonTitle */
    [JHSysAlertUtil presentAlertWithTitle:@"标题" message:@"This is message" actionTitles:@[@"first", @"second", @"third"] preferredStyle:UIAlertControllerStyleActionSheet handler:^(NSUInteger buttonIndex, NSString *buttonTitle) {
        NSLog(@"@@~~ : %lu, %@", (unsigned long)buttonIndex, buttonTitle);
    }];

欢迎到 我的博客 中留言交流~

About

UIAlertController 封装为工具类,通过 block,一句代码调用


Languages

Language:Objective-C 100.0%