![](/img/trans.png)
[英]how can pass data back from current screen to previous screen after clicking back button, ios
[英]how to create a back button in ios that goes to previous screen
如果您使用的是UINavigationController,请使用以下命令:
if let navController = self.navigationController {
navController.popViewController(animated: true)
}
如果您要呈现视图控制器,请使用以下命令:
self.dismiss(animated: true, completion: nil
如果要弹出到rootViewController
(导航堆栈中的第一个视图),请使用以下命令:
if let navigationController = self.window?.rootViewController as?
UINavigationController {
navigationController.popToRootViewControllerAnimated(true)
}
如果您将任何吊舱/库用作侧面菜单,请使用其文档或提供有问题的详细信息,以便我们提供帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.