Swift 跳转storyboard界面黑屏解决办法

在通过storyboard创建viewController后,使用present来跳转界面:

let setPassVc = findPassViewController()
                self.present(setPassVc, animated: true, completion: {
                    print("跳转啦")
                })

会发现出现黑屏的情况
(如果此处写completion:nil 会无法跳转,出现断点)

此时应在图中
设置storyboard IDSwift 跳转storyboard界面黑屏解决办法
之后通过以下语句调用

let controller = self.storyboard?.instantiateViewController(withIdentifier: String(describing: type(of: findPassViewController())))
                    as! findPassViewController
                self.present(controller, animated: true, completion: {
                    print("present")
                })

相关文章:

  • 2022-12-23
  • 2021-09-29
  • 2021-12-24
  • 2021-12-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-06-03
  • 2021-11-04
  • 2022-12-23
  • 2021-04-11
  • 2021-07-05
相关资源
相似解决方案