- 采用VFL布局,3.0版本开始核心控件为UIStackView,不依赖任何其余框架,风格与微信几乎零误差
- 3.0版本开始对话框头部新增图片设置
- 3.0版本开始action支持图片设置
- 3.0版本开始,iOS11及其以上系统可单独设置指定action后的间距
- 3.0版本开始支持富文本
- action的排列可灵活设置垂直排列和水平排列
- 每个action的高度自适应
- 支持旋转(横竖屏)
- 可以自定义各种UIView
- 支持对话框毛玻璃和背景蒙层毛玻璃
- 全面适配iPhoneX,iPhoneXR,iPhoneXS,iPhoneXS MAX
platform:ios,'9.0'
target 'MyApp' do
pod 'SPAlertController', '~> 3.0.1'
end
3.0.1版本使背景蒙层动画更加的柔和
SPAlertController *alert = [SPAlertController alertControllerWithTitle:@"我是主标题" message:@"我是副标题" preferredStyle:SPAlertControllerStyleActionSheet];
SPAlertAction *action1 = [SPAlertAction actionWithTitle:@"Default" style:SPAlertActionStyleDefault handler:^(SPAlertAction * _Nonnull action) {}];
SPAlertAction *action2 = [SPAlertAction actionWithTitle:@"Destructive" style:SPAlertActionStyleDestructive handler:^(SPAlertAction * _Nonnull action) {}];
SPAlertAction *action3 = [SPAlertAction actionWithTitle:@"Cancel" style:SPAlertActionStyleCancel handler:^(SPAlertAction * _Nonnull action) {}];
[alert addAction:action1];
[alert addAction:action2];
[alert addAction:action3];
[self presentViewController: alert animated:YES completion:^{}];
+ (instancetype)alertControllerWithTitle:(nullable NSString *)title message:(nullable NSString *)message preferredStyle:(SPAlertControllerStyle)preferredStyle;
+ (instancetype)alertControllerWithTitle:(nullable NSString *)title message:(nullable NSString *)message preferredStyle:(SPAlertControllerStyle)preferredStyle animationType:(SPAlertAnimationType)animationType;
上面2种创建方式唯一的区别就是:第2种方式多了一个animationType参数,该参数可以设置弹出动画。如果以第一种方式创建,会采用默认动画,默认动画跟preferredStyle 有关,如果是SPAlertControllerStyleActionSheet样式,默认动画为从底部弹出,如果是SPAlertControllerStyleAlert样式,默认动画为从中间弹出
platform:ios,'9.0'
target 'MyApp' do
pod 'SPAlertController', '~> 3.0'
end
3.0版本进行了全方位的大重构
platform:ios,'8.0'
target 'MyApp' do
pod 'SPAlertController', '~> 2.5.2'
end
按钮处于最底部时长按touchDown事件的延时现象采用新方式解决,另外修复了内存泄露问题
platform:ios,'8.0'
target 'MyApp' do
pod 'SPAlertController', '~> 2.5.1'
end
此版本修改了action的选中效果,以及解决iOS11之后,按钮处于最底部时长按touchDown事件的延时现象
platform:ios,'8.0'
target 'MyApp' do
pod 'SPAlertController', '~> 2.5.0'
end
此版本在2.2.1版本的基础上主要改动有:
1、毛玻璃思路另辟蹊径,毛玻璃效果不会受到背景遮罩的影响,同时背景遮罩不再被镂空
2、增加动画枚举,可以从左右弹出
3、自定义view时的背景色改为透明色
4、增加actionHeight属性,修复maxNumberOfActionHorizontalArrangementForAlert属性
5、去除了中间tableView的最后一条分割线
6、修改了分割线的颜色,更加接近微信原生
7、修复centerView上有textView/textField,旋转屏幕后不可见问题
8、优化代码
platform:ios,'8.0'
target 'MyApp' do
pod 'SPAlertController', '~> 2.1.1'
end
platform:ios,'8.0'
target 'MyApp' do
pod 'SPAlertController', '~> 2.1.0'
end
platform:ios,'8.0'
target 'MyApp' do
pod 'SPAlertController', '~> 2.0'
end
platform:ios,'8.0'
target 'MyApp' do
pod 'SPAlertController', '~> 1.7.0'
end
platform:ios,'8.0'
target 'MyApp' do
pod 'SPAlertController', '~> 1.0.1'
end



















