SheetPresentationManager
public final class SheetPresentationManager : NSObject
extension SheetPresentationManager: UIViewControllerTransitioningDelegate
extension SheetPresentationManager: UIAdaptivePresentationControllerDelegate
An object that creates instances of SheetPresentationController when
set as a view controller’s transitioningDelegate.
-
Creates a
SheetPresentationManagerwith specific presentation options and tap handler.Declaration
Swift
public init( options: SheetPresentationOptions = .default, dimmingViewTapHandler: DimmingViewTapHandler = .default )Parameters
optionsThe options to use for presenting view controllers.
dimmingViewTapHandlerA handler to be called when tapping the dimming view. The
dimmingViewAlphaof the givenoptionsmust not benil, or the dimming view will not be created. -
Defines the animator object to use when presenting the view controller.
Declaration
Swift
public func animationController( forPresented presented: UIViewController, presenting: UIViewController, source: UIViewController ) -> UIViewControllerAnimatedTransitioning?Parameters
presentedThe view controller that is about to be presented onscreen.
presentingThe view controller that is presenting the view controller in the
presentedparameter. The object in this parameter could be the root view controller of the window, a parent view controller that is marked as defining the current context, or the last view controller that was presented. This view controller may or may not be the same as the one in thesourceparameter.sourceThe view controller whose
present(_:animated:completion:)method was called.Return Value
The animator object to use when presenting the view controller or
nilto use the system animator. -
Defines the animator object to use when dismissing the view controller.
Declaration
Swift
public func animationController( forDismissed dismissed: UIViewController ) -> UIViewControllerAnimatedTransitioning?Parameters
dismissedThe view controller that is about to be dismissed.
Return Value
The animator object to use when dismissing the view controller or
nilto use the system animator. -
Defines the custom presentation controller to use for managing the view hierarchy when presenting a view controller.
Declaration
Swift
public func presentationController( forPresented presented: UIViewController, presenting: UIViewController?, source: UIViewController ) -> UIPresentationController?Parameters
presentedThe view controller being presented.
presentingThe view controller that is presenting the view controller in the
presentedparameter. The object in this parameter could be the root view controller of the window, a parent view controller that is marked as defining the current context, or the last view controller that was presented. This view controller may or may not be the same as the one in thesourceparameter. This parameter may also benilto indicate that the presenting view controller will be determined later.sourceThe view controller whose
present(_:animated:completion:)method was called to initiate the presentation process.Return Value
The custom presentation controller for managing the modal presentation.
-
Defines the modal presentation style for the controller given a set of traits.
Declaration
Swift
public func adaptivePresentationStyle( for controller: UIPresentationController, traitCollection: UITraitCollection ) -> UIModalPresentationStyleParameters
controllerThe presentation controller that is managing the size change.
traitCollectionThe traits representing the target environment.
Return Value
The new presentation style, which must be
UIModalPresentationStyle.fullScreen,UIModalPresentationStyle.overFullScreen, orUIModalPresentationStyle.none. -
Defines the modal presentation style for the controller.
Declaration
Swift
public func adaptivePresentationStyle( for controller: UIPresentationController ) -> UIModalPresentationStyleParameters
controllerThe presentation controller that is managing the size change.
Return Value
The new presentation style, which must be
UIModalPresentationStyle.fullScreen,UIModalPresentationStyle.overFullScreen, orUIModalPresentationStyle.none.
View on GitHub
Install in Dash
SheetPresentationManager Class Reference