当前位置

网站首页> 程序设计 > 开源项目 > 编程语言 > 浏览文章

Alert 简化使用 XJAlertManager

作者:小梦 来源: 网络 时间: 2024-05-02 阅读:

Git@OSC 的 Android 和 iOS 客户端全面开源

XJAlertManager 是簡化 iOS 原生 Alert, ActionSheet 的使用方法,將 iOS7、iOS8 收納在一起,讓您使用起來更加方便。

安装

安裝 pod 'BlocksKit'

使用示例

//Alert 
XJAlertManager *alert = [XJAlertManager alertWithTitle:@"title" message:@"message" viewController:self];[alert addButtonWithTitle:@"OK" handler:^{}];[alert addCancelButtonWithTitle:@"CANCEL" handler:^{}];[alert show];

//ActionSheet 
XJAlertManager *alert = [XJAlertManager actionSheetWithTitle:@"title" message:@"message" viewController:self];[alert addButtonWithTitle:@"OK" handler:^{}];[alert addCancelButtonWithTitle:@"CANCEL" handler:^{}];[alert show];

相关阅读