菜鸟教程小白 发表于 2022-12-11 20:02:11

ios - swift 3.0中的返回事件在哪里?


                                            <p><p>我想在后按时刷新整个页面 Controller 。
我正在使用代码导航 ViewController 。</p>

<p>我的代码</p>

<pre><code>let GTC = self.storyboard?.instantiateViewController(withIdentifier: &#34;GoToCart&#34;)as! GoToCart
self.navigationController?.pushViewController(GTC, animated: true)
</code></pre></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>使用 <code>viewWillAppear</code> 重新加载您的 UI。当您使用 <code>navigationController?.pushViewController</code> 时, View 将被保留并存储在堆栈中。</p>

<pre><code>override func viewWillAppear(_ animated: Bool) {
    super.viewWillAppear(animated)
    // Reload the UI         
}
</code></pre></p>
                                   
                                                <p style="font-size: 20px;">关于ios - swift 3.0中的返回事件在哪里?,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/44905027/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/44905027/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - swift 3.0中的返回事件在哪里?