使用类似代码在你的视图控制器中显示自定义操作提示弹窗
UGDAlertViewController* actionVC = [[UGDAlertViewController alloc] initWithTitle:@"Alert title"
text:@"Want to use custom alert view with call to action?"
icon:nil
actionTitle:@"Sure"
negative:@"No, thanks"];
[actionVC setMargin:UIEdgeInsetsMake(self.topLayoutGuide.length, 0, self.bottomLayoutGuide.length, 0)];
[actionVC showInViewController:self withCompletion:^(BOOL accepted) {
// your code here
// (accepted == YES) if user pressed the call to action button
// remove alert view
[actionVC hideAnimated:YES];
}];
iOS 7 及以上版本
UGDAlertView 可通过 CocoaPods 获取。要安装它,只需将以下行添加到你的 Podfile 中
pod "UGDAlertView"
Afinello
UGDAlertView 可在 MIT 许可证下使用。查看 LICENSE 文件获取更多信息。