2016-10-05 19 views
2

我試圖在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 < _>」

+0

我有同樣的問題,你有沒有解決這個問題? – Alex

+1

@Alex本人沒有弄清楚這一點:( – vishalaksh

+0

我剛剛結束了使用內置的方法,並手動修改視圖控制器在加載方法。 – Alex

回答

1

爲什麼你不「T使用:

<<< ButtonRow("Rows") { 
       $0.title = $0.tag 
       $0.presentationMode = .segueName(segueName: "YourSegue", onDismiss: nil) 
      } 
2

參數completionCallback尤里卡版本2改變爲onDismiss