OGeek|极客世界-中国程序员成长平台

标题: ios - swift 3.0中的返回事件在哪里? [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-11 20:02
标题: ios - swift 3.0中的返回事件在哪里?

我想在后按时刷新整个页面 Controller 。 我正在使用代码导航 View Controller 。

我的代码

let GTC = self.storyboard?.instantiateViewController(withIdentifier: "GoToCart")as! GoToCart
self.navigationController?.pushViewController(GTC, animated: true)



Best Answer-推荐答案


使用 viewWillAppear 重新加载您的 UI。当您使用 navigationController?.pushViewController 时, View 将被保留并存储在堆栈中。

override func viewWillAppear(_ animated: Bool) {
    super.viewWillAppear(animated)
    // Reload the UI           
}

关于ios - swift 3.0中的返回事件在哪里?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44905027/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://ogeek.cn/) Powered by Discuz! X3.4