Skip to content

Instantly share code, notes, and snippets.

@iamidzic
Last active April 20, 2021 12:14
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 iamidzic/e1d012cad4fa7fbb7b0eb491129e4acf to your computer and use it in GitHub Desktop.
Save iamidzic/e1d012cad4fa7fbb7b0eb491129e4acf to your computer and use it in GitHub Desktop.
Present/Push SwiftUI view in VC
// Present hostingController
let hostingController = UIHostingController(rootView: SettingsView())
present(hostingController, animated: true, completion: nil)
// Push hostingController
let hostingController = UIHostingController(rootView: SettingsView())
navigationController?.pushViewController(hostingController, animated: true)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment