Skip to content

Instantly share code, notes, and snippets.

@edudnyk
Last active October 3, 2021 07:09
Show Gist options
  • Save edudnyk/00cf89a01b129a088e04a909434cdcec to your computer and use it in GitHub Desktop.
Save edudnyk/00cf89a01b129a088e04a909434cdcec to your computer and use it in GitHub Desktop.
The snippet of the public interface provided by SheeKit
public struct DismissAction {
public func callAsFunction()
}
extension EnvironmentValues {
public internal(set) var shee_dismiss: DismissAction
public internal(set) var shee_isPresented: Bool
}
extension View {
public func shee<Content>(isPresented: Binding<Bool>,
presentationStyle: ModalPresentationStyle = .automatic,
presentedViewControllerParameters: UIViewControllerProxy? = nil,
onDismiss: (() -> Void)? = nil,
@ViewBuilder content: @escaping () -> Content) -> some View where Content : View
public func shee<Item, Content>(item: Binding<Item?>,
presentationStyle: ModalPresentationStyle = .automatic,
presentedViewControllerParameters: UIViewControllerProxy? = nil,
onDismiss: (() -> Void)? = nil,
@ViewBuilder content: @escaping (Item) -> Content) -> some View where Item : Identifiable, Content : View
public func shee_interactiveDismissDisabled(_ isDisabled: Bool = true) -> some View
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment