PresentationController
@MainActor
open class PresentationController : UIPresentationController
自定义展示控制器。默认显示暗色背景动画且弹出视图占满容器,可通过属性自定义
-
是否显示暗色背景,默认true
Declaration
Swift
@MainActor open var showDimming: Bool { get set }
-
是否可以点击暗色背景关闭,默认true。如果弹出视图占满容器,手势不生效(因为弹出视图挡住了暗色背景),也可开启弹出视图isPenetrable让手势强制生效
Declaration
Swift
@MainActor open var dimmingClick: Bool { get set }
-
是否执行暗黑背景透明度动画,默认true
Declaration
Swift
@MainActor open var dimmingAnimated: Bool
-
暗色背景颜色,默认黑色,透明度0.5
Declaration
Swift
@MainActor open var dimmingColor: UIColor?
-
设置点击暗色背景关闭时是否执行动画,默认true
Declaration
Swift
@MainActor open var dismissAnimated: Bool
-
设置点击暗色背景关闭完成回调(非交互才会触发),默认nil
Declaration
Swift
@MainActor open var dismissCompletion: (() -> Void)?
-
设置弹出视图的圆角位置,默认左上和右上。如果弹出视图占满容器,不生效需弹出视图自定义
Declaration
Swift
@MainActor open var rectCorner: UIRectCorner
-
设置弹出视图的圆角半径,默认0无圆角。如果弹出视图占满容器,不生效需弹出视图自定义
Declaration
Swift
@MainActor open var cornerRadius: CGFloat
-
自定义弹出视图的frame计算block,默认nil占满容器,优先级高
Declaration
Swift
@MainActor open var frameBlock: ((PresentationController) -> CGRect)?
-
设置弹出视图的frame,默认CGRectZero占满容器,优先级中
Declaration
Swift
@MainActor open var presentedFrame: CGRect
-
设置弹出视图的居中size,默认CGSizeZero占满容器,优先级中
Declaration
Swift
@MainActor open var presentedSize: CGSize
-
设置弹出视图的顶部距离,默认0占满容器,优先级低
Declaration
Swift
@MainActor open var verticalInset: CGFloat
-
设置弹出视图的横向距离,默认0占满容器,优先级低
Declaration
Swift
@MainActor open var horizontalInset: CGFloat
-
Undocumented
Declaration
Swift
@MainActor override open func presentationTransitionWillBegin()
-
Undocumented
Declaration
Swift
@MainActor override open func dismissalTransitionWillBegin()
-
Undocumented
Declaration
Swift
@MainActor override open func dismissalTransitionDidEnd(_ completed: Bool)
-
Undocumented
Declaration
Swift
@MainActor override open var frameOfPresentedViewInContainerView: CGRect { get }