addSubview SwiftUI View to UIKit UIView in Swift
Step 1: Create instances of UIHostingController by using SwiftUI View struct ContentView : View { var body: some View { VStack { Text(“Test”) Text(“Test2”) } } } var child = UIHostingController(rootView: ContentView()) Step 2: Add instance of UIHostingController as a child view controller to Any UIKit ViewController var parent = UIViewController() child.view.translatesAutoresizingMaskIntoConstraints = false child.view.frame … Read more