Skip to content

Instantly share code, notes, and snippets.

@edudnyk
Last active October 1, 2021 04:26
Show Gist options
  • Save edudnyk/01ba1c3f709d4420f18ed99fb02d996e to your computer and use it in GitHub Desktop.
Save edudnyk/01ba1c3f709d4420f18ed99fb02d996e to your computer and use it in GitHub Desktop.
Initial sandwich solution implementation in SheeKit
final class SheetHostingController<Item>: UIHostingController<AnyView> where Item : Identifiable {
var itemId: Item.ID?
var item: Item
var onDismiss: (() -> Void)?
init(rootView: AnyView, item: Item) {
self.itemId = item.id
self.item = item
super.init(rootView: rootView)
}
@available(*, unavailable)
@MainActor
@objc
required dynamic init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment