Skip to content

Instantly share code, notes, and snippets.

@badrinathvm
Last active January 18, 2020 03:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save badrinathvm/c8f478b3ca5467fcc407cdf2bf70b962 to your computer and use it in GitHub Desktop.
Save badrinathvm/c8f478b3ca5467fcc407cdf2bf70b962 to your computer and use it in GitHub Desktop.
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
let swiftUIView = UIHostingController(rootView: SwiftUIView())
swiftUIView.view.translatesAutoresizingMaskIntoConstraints = false
self.addSubview(swiftUIView.view)
swiftUIView.view.layout {
$0.top == self.view.topAnchor
$0.leading == self.view.leadingAnchor
$0.trailing == self.view.trailingAnchor
$0.bottom == self.view.bottomAnchor
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment