根据OS进行分支,分别使用UIAlertView和UIAlertController
pod 'TAKAlertUtil'
需要使用ReactiveCocoa
#import "TAKAlertUtil.h"
[[TAKAlertUtil showWithTitle:@"Title"
message:@"Alert message"
buttonTitles:@[@"Cancel",@"OK"]] subscribeNext:^(id x) {
if ([x intValue] == 0) {
NSLog(@"Cancel button tapped.");
} else {
NSLog(@"OK button tapped.");
}
}];
TAKAlertUtil采用MIT许可证发布。详细信息请参阅LICENSE。