- iOS Programming Cookbook
- Hossam Ghareeb
- 118字
- 2021-07-09 18:29:48
Push and pop
We saw in the preceding example how to navigate to another view controller using segues. Additionally, we can do this programmatically by calling the following:
self.navigationController?.pushViewController(viewController, animated: true)
This pushes a new view controller with or without animation.
Also, to pop view controllers, we have three functions that we can use:
- The popViewControllerAnimated function: This will pop the top view controller and update the UI to the preceding one
- The popToRootViewControllerAnimated function: This will pop all view controllers in the stack, but the root view controller
- The popToViewController:animated function: This will pop all view controllers in the stack not upto the root but upto a given reference to the view controller to pop to it
推薦閱讀
- 操作系統(tǒng)實(shí)用教程(Linux版)
- 奔跑吧 Linux內(nèi)核(入門篇)
- Windows Server 2012網(wǎng)絡(luò)操作系統(tǒng)企業(yè)應(yīng)用案例詳解
- Windows 7中文版從入門到精通(修訂版)
- Kali Linux 2018:Windows Penetration Testing
- 計(jì)算機(jī)系統(tǒng):基于x86+Linux平臺(tái)
- 分布式系統(tǒng)設(shè)計(jì)實(shí)踐
- Linux集群之美
- Zabbix監(jiān)控系統(tǒng)之深度解析和實(shí)踐
- Linux內(nèi)核分析及應(yīng)用
- VMware vSphere 5.1 Cookbook
- Windows網(wǎng)絡(luò)編程(第2版)
- 操作系統(tǒng)之哲學(xué)原理第2版
- 樹莓派+傳感器:創(chuàng)建智能交互項(xiàng)目的實(shí)用方法、工具及最佳實(shí)踐
- Linux從入門到精通