Last active
October 1, 2021 04:26
-
-
Save edudnyk/01ba1c3f709d4420f18ed99fb02d996e to your computer and use it in GitHub Desktop.
Initial sandwich solution implementation in SheeKit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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