So I'm pushing a side menu onto my root menu using a modal segue and then attempting to dismiss the side menu that only covers half the page and performing the segue from the root vc when a button is pressed in the side menu. It either returns; recivere has no sague with identifier, or warning: attempt to perform segue that is not in window hierarchy.
func SubmitSettingPressed (sender: UIButton){
let mainView = MainViewController()
dismiss(animated: true) {
let vc = storyboard?.instantiateViewController(withIdentifier: "MainViewController") as? MainViewController
vc?.ToSubmition()
}
then in the root vc
func ToSubmition(){
self.performSegue(withIdentifier: "ToSubmition", sender: self)
}