【发布时间】:2018-02-06 09:08:10
【问题描述】:
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"
}
}
当我弹出到导航控制器时,我无法接收数据
【问题讨论】:
-
使用
delegation或Notification -
如果我不想使用委托,我应该这样做吗?
-
@PuChaisirikul 这是 iOS 使用委托的常用方式。但是你可以使用回调来代替它们
-
使用 swift Closure 传回数据