当我们用present进行界面跳转时,会涉及到一个传向关系。

比如:A -> B    界面A跳转界面B

 

A.presentedViewControlle = B

B.presentingViewController = A

 

这就是两者间的关系。

 

所以有以下使用场景:

当界面B又跳转了界面C,在C关闭的时候,我们也想关闭B,可以这样:

  let B = self.presentingViewController        
  self.dismiss(animated: true) {
       B?.dismiss(animated: true, completion: nil)
  }

 

相关文章:

  • 2022-01-18
  • 2021-05-18
  • 2021-10-17
  • 2021-07-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-29
  • 2022-12-23
  • 2021-07-28
  • 2021-09-24
相关资源
相似解决方案