How to prevent present modally an active controller?

前端 未结 4 1119
情歌与酒
情歌与酒 2021-01-11 16:11

We have 2 controllers: MainVC and ProfileVC. From MainVC we go to ProfileVC with profileButton press (left item on navigation bar).

In Profile VC we hav

4条回答
  •  无人及你
    2021-01-11 16:51

    To prevent this exception. Simply just dismiss the currently showed ViewController to go back to the caller of the ViewController that you are dismissing:

    self.dismiss(animated: true, completion: nil)
    

提交回复
热议问题