Swift performSegueWithIdentifier shows black screen

后端 未结 2 812
醉话见心
醉话见心 2020-12-22 05:40

I have read through a lot of different posts regarding this issue, but none of the solutions seemed to work for me.

I started a new app and I placed the initial Vie

2条回答
  •  清歌不尽
    2020-12-22 06:26

    By following the steps that @ronatory had laid out so well for me in the accepted answer, I was able to see that I had set up my TraitViewController as a UIPageViewController instead of UIViewController.. and so it didn't generate any errors, but it just took me to a black screen. Feel silly that I read through my code so many times and never noticed this.

    Main point: If you're getting a black screen on a ViewController randomly, make sure your class is extending the correct parent class. in my case:

    class TraitViewController: UIPageViewController {
    

    needed to be

    class TraitViewController: UIViewController {
    

提交回复
热议问题