Performing segue after dismissing modal swift

人走茶凉 提交于 2019-12-12 01:29:02

问题


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)
}

来源:https://stackoverflow.com/questions/42459786/performing-segue-after-dismissing-modal-swift

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!