ios swift present() UIViewController 深入了解

191 阅读1分钟

常用 present
parentController.present(controller, animated: true)

  • which is already presenting

**<xx.GSTabBarViewController: 0x15405d000> (from <xx.GSPlayViewController: 0x154071200>) which is already presenting <xx.GSShareViewController: 0x153debdc0>.**

**"deinit: xx.GSPlayFontViewController"**

可以用presentedViewController 是否为nil ,来判断是否present过。

let presentedViewController = parentController.presentedViewController

如下:

image.png

  • 网上看到的另外一种解法,未试,你要是试了 ,评论区告诉结果 image.png