【发布时间】:2019-04-12 03:49:15
【问题描述】:
我想要一个想法,在将数据保存到数据库完成后,然后弹出当前视图控制器。 我该怎么做。希望您能够帮助我。谢谢
更新--------------- 这是我现在的代码。
/**
The VC is puch in. When the VC will disappear, include pop with click back BarButtonItem, or pop by side swipeGestureRecognizer. I upload the data to server.
But it not perfect
*/
override func viewWillDisappear(_ animated: Bool) {
NetworkSyncManager.syncyData { [unowned self](resutl) in
self.endRefreshing()
}
}
【问题讨论】:
-
在你的VC中使用这段代码来弹出它。 self.dismiss(动画:真,完成:无)。或者请看一下 unwind segue。顺便说一句,您可以在此处添加一些代码以清楚地解决您的问题
-
感谢您的回复。我用我的代码更新了这个问题。