作者热门文章
- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
class ListBillPaymentFavoriteRouter: NSObject, ListBillPaymentFavoriteRoutingLogic, ListBillPaymentFavoriteDataPassing {
weak var viewController: ListBillPaymentFavoriteViewController?
var dataStore: ListBillPaymentFavoriteDataStore?
// MARK: Routing
func routeToBillPaymentInput() {
let destinationVC = BillPaymentInputViewController.instantiate()
var destinationDS = destinationVC.router!.dataStore!
passDataToBillPaymentInput(source: dataStore!, destination: &destinationDS)
navigationToBillPaymentInput(source: viewController!, destination: destinationVC)
}
// MARK: Navigation
func navigationToBillPaymentInput(source: ListBillPaymentFavoriteViewController, destination: BillPaymentInputViewController) {
source.navigationController?.pop_FromLeftMoveToRight()
}
// MARK: Passing data
func passDataToBillPaymentInput(source: ListBillPaymentFavoriteDataStore, destination: inout BillPaymentInputDataStore) {
destination.testTest = "Yessssss"
}
}
当我弹出到 navigationController 时,我无法接收数据
最佳答案
我们应该可以查看 Controller ,例如
func routeToBillPaymentInput() {
let index = viewController!.navigationController!.viewControllers.count - 2
let destinationVC = viewController?.navigationController?.viewControllers[index] as! BillPaymentInputViewController
var destinationDS = destinationVC.router!.dataStore!
passDataToBillPaymentInput(source: dataStore!, destination: &destinationDS)
navigationToBillPaymentInput(source: viewController!, destination: destinationVC)
}
关于swift - Clean swift 如何将数据传回 viewController,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48639191/
我是一名优秀的程序员,十分优秀!