要运行示例项目,请克隆仓库,并首先从示例目录运行pod install
。
IDAlertController使用类似于UIAlertController的语法
IDAlertController *alertController = [IDAlertController alertControllerWithTitle:@"Hello world" message:nil preferredStyle:IDAlertCsontrollerStyleActionSheet];
[alertController addActionWithTitle:@"Cancel" style:IDAlertActionStyleCancel handler:^(IDAlertAction *action) {
NSLog(@"Cancel");
}];
[alertController addActionWithTitle:@"Destructive" style:IDAlertActionStyleDestructive handler:^(IDAlertAction *action) {
NSLog(@"Destructive");
}];
[alertController addActionWithTitle:@"Option one" style:IDAlertActionStyleDefault handler:^(IDAlertAction *action) {
NSLog(@"Option one");
}];
[alertController addActionWithTitle:@"Option two" style:IDAlertActionStyleDefault handler:^(IDAlertAction *action) {
NSLog(@"Option two");
}];
[alertController show];
Ivan Damjanović,[email protected]
IDAlertController在MIT许可下可用。有关更多信息,请参阅LICENSE文件。