从选项卡控制器在当前上下文中呈现模型视图控制器后出现黑屏

Black screen after presenting model view controller in current context from tab controller

我正在为我自己的应用程序创建弹出式错误消息。我遵循了 Youtube 中的教程。由于我的应用程序是一个选项卡栏应用程序,当弹出窗口出现时,用户按下另一个选项卡,然后返回到该特定选项卡,背景已更改!!!!知道这里发生了什么吗?

1.这是弹出窗口出现的时候

2.This 一种是更改选项卡然后返回到该特定选项卡

3.This 是用户在更改选项卡后关闭弹出窗口的最后状态

none 如果用户在开始时关闭弹出窗口,就会发生这些错误!

let next = self.storyboard?.instantiateViewController(withIdentifier: "ErrorVC")
self.present(next!, animated: true, completion: nil)

这是我在我的页面中使用的代码,用于在满足条件时显示 pop!!!

我有 2 个 viewController,第二个是弹出窗口。

在显示 pop-view

的第一个 viewController 中将 definesPresentationContext 属性 设置为 UIViewControllertrue
override func viewDidLoad() {
    super.viewDidLoad()
    definesPresentationContext = true
}