Swift performSegueWithIdentifier not working

后端 未结 8 1524
礼貌的吻别
礼貌的吻别 2020-12-01 04:13

I am trying to switch view controllers after a user successfully logs in to their account, but it is not working correctly. I cant use a segue directly because if the login

8条回答
  •  生来不讨喜
    2020-12-01 04:52

    Check to make sure you are running the perform segue on a visible view controller.

    This is an edge case, but my perform segue failed when I attempted to run it on the view controller belonging to my UIPageViewController that was not currently visible. It also failed if I attempted to do the segue on all view controllers belonging to my UIPageViewController, including the view controller currently visible. The fix was to track which view controller was currently visible in my UIPageViewController, and only perform the segue on that view controller.

提交回复
热议问题