[英]How To Remove The First ViewController In The Background?
I have two view controllers, first view controller and the second view controller, when the user segue from the first view controller to the second view controller, the first view controller still visible and sits behind the second view controller.我有两个视图控制器,第一个视图控制器和第二个视图控制器,当用户从第一个视图控制器转到第二个视图控制器时,第一个视图控制器仍然可见并位于第二个视图控制器后面。 The user can swipe the first view controller and see the entire first view controller and then they got stuck there.用户可以滑动第一个视图控制器并看到整个第一个视图控制器,然后他们就卡在那里了。 I noticed that this only happens after the launch of iOS 13.我注意到这只会在 iOS 13 发布之后发生。
performSegue(withIdentifier: "showSecond", sender: self)
@Maysam is 100% right! @Maysam 是 100% 正确的! But you can also do it programmatically through this:但是您也可以通过以下方式以编程方式执行此操作:
// Go to next View Controller
@IBAction func nextTextVC(_ sender: UIButton) {
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let nextInfo = storyboard.instantiateViewController(identifier: "socialOptionsIntroViewController")
self.navigationController?.pushViewController(nextInfo, animated: true)
}
There is a more detail thread could answer this question.有一个更详细的线程可以回答这个问题。
The follow solution from Pratik Sodha来自 Pratik Sodha 的以下解决方案
let controller = UIViewController()
let navigationController = UINavigationController(rootViewController: controller)
navigationController.modalPresentationStyle = .overCurrentContext
self.navigationController?.present(navigationController, animated: true, completion: nil)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.