Created
September 14, 2023 06:57
-
-
Save imjhk03/af4787ec7a2590f3c39a96be5a466482 to your computer and use it in GitHub Desktop.
Make SwiftUI view to UIView
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
extension View { | |
func hostingView() -> UIView { | |
let hostingView = UIHostingController(rootView: self) | |
return hostingView.view | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment