SheetPresentationOptions
public struct SheetPresentationOptions
Options for presentation. These options are passed to created
SheetPresentationController
objects upon creation.
-
Options for the corners of the presented view controller.
See moreDeclaration
Swift
public enum CornerOptions : Equatable
-
The corner radius options to apply to the presented view controller.
Declaration
Swift
public let cornerOptions: CornerOptions
-
The
alpha
value for the dimming view used behind the presented view controller. The color is black. Usenil
to avoid adding a dimming view behind the presented view controller.Declaration
Swift
public let dimmingViewAlpha: CGFloat?
-
The amount to inset the presented view controller from the presentation container. This is a minimum; there may be additional insets depending on the safe area insets and margins of the container. Use
ignoredEdgesForMargins
to customize the margin behavior for each edge.Declaration
Swift
public let edgeInsets: DirectionalEdgeInsetsConvertible
-
Edges of the presentation container view for which its margins should be ignored for layout purposes, including the safe area.
Declaration
Swift
public let ignoredEdgesForMargins: [ViewEdgeConvertible]
-
The location to place the presented view controller’s view in the presentation container.
Declaration
Swift
public let presentationLayout: PresentationLayout
-
The animation behavior to use when the presented view controller is appearing or being dismissed.
Declaration
Swift
public let animationBehavior: AnimationBehavior
-
The default options that are used when calling
init()
on aSheetPresentationManager
with no options.Declaration
Swift
public static let `default`: SheetPresentationOptions
-
init(cornerOptions:
dimmingViewAlpha: edgeInsets: ignoredEdgesForMargins: presentationLayout: animationBehavior: ) Creates a value with provided
CornerOptions
.Declaration
Swift
public init( cornerOptions: CornerOptions = .roundAllCorners(radius: 10), dimmingViewAlpha: CGFloat? = 0.5, edgeInsets: DirectionalEdgeInsetsConvertible = constantInsets(20), ignoredEdgesForMargins: [ViewEdgeConvertible] = [], presentationLayout: PresentationLayout = .default, animationBehavior: AnimationBehavior = .system )
Parameters
cornerOptions
CornerOptions
to use.dimmingViewAlpha
The
alpha
value for the dimming view used behind the presented view controller. The color is black. Defaults to0.5
. Usenil
to avoid using a dimming view.edgeInsets
The amount to inset the presented view controller from the presenting view controller. This is a minimum; there may be additional insets depending on the safe area insets of the presenting view controller’s view (iOS 11 and later). Defaults to edge insets of
20
points on each side.ignoredEdgesForMargins
Edges of the presenting view controller’s view for which its margins should be ignored for layout purposes, including the safe area.
presentationEdge
Edge of the screen from which to present. Defaults to
.bottom
.animationBehavior
The way that the presentation animates the appearance and dismissal of the presented view controller.