可以在控制器和窗口上显示,支持自定义视图,自定义动画,使用 AutoLayout,支持 iPhone、iPad。如果 ScottAlertController 能帮助到你,我希望你能给它 star。
pod 'ScottAlertController'
在控制器上展示
ScottAlertView *alertView = [ScottAlertView alertViewWithTitle:@"ScottAlertView" message:@"这是一段描述文字这是一段描述文字这是一段描述文字这是一段描述文字这是一段描述文字这是一段描述文字."];
[alertView addAction:[ScottAlertAction actionWithTitle:@"取消" style:ScottAlertActionStyleCancel handler:^(ScottAlertAction *action) {
}]];
[alertView addAction:[ScottAlertAction actionWithTitle:@"确定" style:ScottAlertActionStyleDestructive handler:^(ScottAlertAction *action) {
}]];
ScottAlertViewController *alertController = [ScottAlertViewController alertControllerWithAlertView:alertView preferredStyle:ScottAlertControllerStyleAlert transitionAnimationStyle:ScottAlertTransitionStyleDropDown];
alertController.tapBackgroundDismissEnable = YES;
[self presentViewController:alertController animated:YES completion:nil];
在窗口上展示
ScottAlertView *alertView = [ScottAlertView alertViewWithTitle:@"提示" message:@"这是一个显示在窗口的alertView"];
ScottAlertAction *action = [ScottAlertAction actionWithTitle:@"好的" style:ScottAlertActionStyleDestructive handler:nil];
[alertView addAction:action];
[ScottShowAlertView showAlertViewWithView:alertView backgroundDismissEnable:YES];
使用模糊效果展示
ScottAlertView *alertView = [ScottAlertView alertViewWithTitle:@"ScottAlertView" message:@"这是一段描述文字这是一段描述文字这是一段描述文字这是一段描述文字这是一段描述文字这是一段描述文字."];
[alertView addAction:[ScottAlertAction actionWithTitle:@"取消" style:ScottAlertActionStyleCancel handler:^(ScottAlertAction *action) {
}]];
[alertView addAction:[ScottAlertAction actionWithTitle:@"确定" style:ScottAlertActionStyleDestructive handler:^(ScottAlertAction *action) {
}]];
ScottAlertViewController *alertController = [ScottAlertViewController alertControllerWithAlertView:alertView preferredStyle:ScottAlertControllerStyleAlert transitionAnimationStyle:ScottAlertTransitionStyleFade];
[alertController setBlurEffectWithView:self.view style:ScottEffectStyleLite];
alertController.tapBackgroundDismissEnable = YES;
[self presentViewController:alertController animated:YES completion:nil];
ScottAlertController 可以在控制器和 window 上显示,支持自定义弹出的 view,弹出动画,采用 AutoLayout 自动布局,支持 iPhone、iPad。
如果 ScottAlertController 能帮助到你,希望你能够给我 star。
pod 'ScottAlertController'
在 Controller 上展示
ScottAlertView *alertView = [ScottAlertView alertViewWithTitle:@"ScottAlertView" message:@"这是一段描述文字这是一段描述文字这是一段描述文字这是一段描述文字这是一段描述文字这是一段描述文字."];
[alertView addAction:[ScottAlertAction actionWithTitle:@"取消" style:ScottAlertActionStyleCancel handler:^(ScottAlertAction *action) {
}]];
[alertView addAction:[ScottAlertAction actionWithTitle:@"确定" style:ScottAlertActionStyleDestructive handler:^(ScottAlertAction *action) {
}]];
ScottAlertViewController *alertController = [ScottAlertViewController alertControllerWithAlertView:alertView preferredStyle:ScottAlertControllerStyleAlert transitionAnimationStyle:ScottAlertTransitionStyleDropDown];
alertController.tapBackgroundDismissEnable = YES;
[self presentViewController:alertController animated:YES completion:nil];
在 Window 上展示
ScottAlertView *alertView = [ScottAlertView alertViewWithTitle:@"提示" message:@"这是一个显示在窗口的alertView"];
ScottAlertAction *action = [ScottAlertAction actionWithTitle:@"好的" style:ScottAlertActionStyleDestructive handler:nil];
[alertView addAction:action];
[ScottShowAlertView showAlertViewWithView:alertView backgroundDismissEnable:YES];
背景模糊方式展示
ScottAlertView *alertView = [ScottAlertView alertViewWithTitle:@"ScottAlertView" message:@"这是一段描述文字这是一段描述文字这是一段描述文字这是一段描述文字这是一段描述文字这是一段描述文字."];
[alertView addAction:[ScottAlertAction actionWithTitle:@"取消" style:ScottAlertActionStyleCancel handler:^(ScottAlertAction *action) {
}]];
[alertView addAction:[ScottAlertAction actionWithTitle:@"确定" style:ScottAlertActionStyleDestructive handler:^(ScottAlertAction *action) {
}]];
ScottAlertViewController *alertController = [ScottAlertViewController alertControllerWithAlertView:alertView preferredStyle:ScottAlertControllerStyleAlert transitionAnimationStyle:ScottAlertTransitionStyleFade];
[alertController setBlurEffectWithView:self.view style:ScottEffectStyleLite];
alertController.tapBackgroundDismissEnable = YES;
[self presentViewController:alertController animated:YES completion:nil];