Created
December 30, 2021 17:23
-
-
Save StanislavK/5b37e7ab115933e2546ab8051219d885 to your computer and use it in GitHub Desktop.
This file contains 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
import SwiftUI | |
struct GenericUIViewControllerRepresentable<ViewControllerType>: UIViewControllerRepresentable | |
where ViewControllerType: UIViewController { | |
let factory: (Context) -> ViewControllerType | |
func makeUIViewController(context: Context) -> ViewControllerType { | |
factory(context) | |
} | |
func updateUIViewController( | |
_ uiViewController: ViewControllerType, | |
context: Context | |
) {} | |
} |
Author
StanislavK
commented
Jan 10, 2022
- also:
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment