So I'm attempting to a cue a segue from a model VC to run on the root VC however when I attempt to do so it gives me this error - Warning: Attempt to present vc whose view is not in the window hierarchy. I tried the viewWIllAppear() but that also doesn't work because my VC only covers half the root vc's view as it is a side menu. However, after cueing a segue directly from the root VC it works fine.
this is the code that I have rn:
dismiss(animated: true) {
let vc = self.storyboard?.instantiateViewController(withIdentifier: "MainViewController") as? MainViewController
vc?.performSegue(withIdentifier: "ToSubmition", sender: self)
}