0

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)
}
Hamish
  • 78,605
  • 19
  • 187
  • 280
Sina
  • 45
  • 7
  • This func SubmitSettingPressed is on the modal viewController? – José Neto Feb 25 '17 at 22:07
  • @Sina Go to Main.storyboard and assign this ID `MainViewController` in the attributes inspector to MainViewController http://imgur.com/a/CvFj0 – bibscy Feb 26 '17 at 05:49
  • @JoséNeto yah the SubmitSettingPressed is on the modal VC – Sina Feb 26 '17 at 23:08
  • @bibscy changing the ID prevents the app from crashing but I still get this error - Warning: Attempt to present on whose view is not in the window hierarchy! – Sina Feb 26 '17 at 23:43
  • @Sina I am not sure what it's causing the error, but you might find this answer helpful http://stackoverflow.com/questions/11862883 – bibscy Feb 27 '17 at 00:29

0 Answers0