我試圖在swift 3中構建一個自定義的演示者行Eureka,當點擊時顯示一個UIViewController
。如何實現自定義演示者行?
的documentation建議如下代碼:
public final class CustomPushRow<T: Equatable>: SelectorRow<PushSelectorCell<T>, SelectorViewController<T>>, RowType {
public required init(tag: String?) {
super.init(tag: tag)
presentationMode = .show(controllerProvider: ControllerProvider.callback {
return SelectorViewController<T>(){ _ in }
}, completionCallback: { vc in
vc.navigationController?.popViewController(animated: true)
})
}
}
在那裏我將與MyViewController
更換SelectorViewController
。但現在它給予下列錯誤(即使沒有更換的UIViewController名):
不能鍵入「ControllerProvider」的值轉換爲 預期的參數類型「ControllerProvider < _>」
我有同樣的問題,你有沒有解決這個問題? – Alex
@Alex本人沒有弄清楚這一點:( – vishalaksh
我剛剛結束了使用內置的方法,並手動修改視圖控制器在加載方法。 – Alex