我有三个 View Controller :1,2,3
我从 1 --> 2
移动,然后从 2 ---> 3
移动,现在我想从 3 ----> 1
等等。
当我位于 3
时,我需要关闭 View Controller 编号 2
因为如果我保留 View Controller 编号“2”,我似乎会出现内存泄漏。如果我多次重复此过程,可能会使应用程序变慢。
最佳答案
试试这个 - 在你的 View Controller 按钮操作中
self.dismiss(animated: true, completion: nil)
关于swift - 在呈现给新 View Controller 之前关闭 View Controller ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51265467/