WZPresentationController
示例
要运行示例项目,请先克隆仓库,然后在 Example 目录中运行 pod install
- 效果图(gif图压缩,实际效果请运行demo)
简介
WZPresentationController 是对 UIPresentationController 的简单封装。项目组很多人以前向keyWindow添加View的方式来实现alert / sheet等功能,这种方法带来了无尽的麻烦,相信很多人都有深刻的体会。
- WZPresentedViewController
继承指定preferredContentSize
设置WZPresentationAnimatedTransitionType给定的基础alert/actionSheet
可以实现自定义的alert/actionSheet提示窗
也可以注册实现以下子类实现自定义功能
- WZPresentationMaskView
蒙板,默认提供了
passthroughViews:指定允许用户与之交互的UIView实例数组
dismissPresentedOnTap:点击遮罩dismiss presentedViewController
WZPresentationAnimatedTransitionType中指定WZPresentationBlurEffectStyle可以实现模糊背景
继承重写注册给WZPresentedViewController可以自定义相关功能需求
- WZPresentationController
实现了WZPresentationMaskView的注册加载
指定alert/actionSheet两种布局格式
继承重写注册给WZPresentedViewController可以自定义相关功能需求
- WZPresentationAnimatedTransitionType
提供了自定义扩展和基础转场动画
- WZPresentationBaseAnimatedTransition
继承WZPresentationBaseAnimatedTransition自定义转场动画
通过WZPresentationAnimatedTransitionType
case custom(WZPresentationBaseAnimatedTransition.Type)
注册给WZPresentedViewController实现
要求
- iOS 8 及以上
安装
WZPresentationController 可通过 CocoaPods 获得。要安装它,只需将以下行添加到您的 Podfile 中
pod 'WZPresentationController'
作者
arcangelw, [email protected]
许可
WZPresentationController 在 MIT 许可下可用。有关更多信息,请参阅 LICENSE 文件。