I have a fairly extensive project that I started with UIKit and now I've decided to use SwiftUI to make some simple form pages, but I need to make a button in SwiftUI to dismiss the current view which is presented with the following code:
func goToSchedule() {
let vc = UIHostingController(rootView: ScheduleView())
if let topController = UIApplication.topViewController() {
topController.present(vc, animated: true, completion: nil)
}
}