Skip to content

Instantly share code, notes, and snippets.

@edudnyk
Last active October 1, 2021 02:55
Show Gist options
  • Save edudnyk/61e535c86f81f92019959d97aa3f435a to your computer and use it in GitHub Desktop.
Save edudnyk/61e535c86f81f92019959d97aa3f435a to your computer and use it in GitHub Desktop.
The snippet of the public interface provided by SheeKit
public enum ModalPresentationStyle {
/// The default presentation style chosen by the system.
case automatic
/// A presentation style that partially covers the underlying content.
///
/// - Parameters:
/// - properties: properties to assign to ``UISheetPresentationController``
case pageSheet(properties: SheetProperties? = nil)
/// A presentation style that displays the content centered in the screen.
///
/// - Parameters:
/// - properties: properties to assign to ``UISheetPresentationController``
case formSheet(properties: SheetProperties? = nil)
/// A view presentation style in which the presented view covers the screen.
case overFullScreen
/// A presentation style where the content is displayed over another view controller’s content.
case overCurrentContext
/// A presentation style where the content is displayed in a popover view.
/// - Parameters:
/// - permittedArrowDirections: The arrow directions that you allow for the popover.
/// - sourceRectTransform: allows to change the ``sourceRect`` of the ``UIPopoverPresentationController``
/// - adaptiveSheetProperties: properties to assign to adaptive ``UISheetPresentationController`` which will be used when the app's scene is resized into ``.compact`` horizontal size class (via multitasking).
case popover(permittedArrowDirections: UIPopoverArrowDirection = .any, sourceRectTransform: ((CGRect) -> CGRect)? = nil, adaptiveSheetProperties: SheetProperties? = nil)
/// A custom view presentation style that is managed by a custom presentation controller and one or more custom animator objects.
case custom(transitioningDelegate: UIViewControllerTransitioningDelegate?)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment