我已经使用Eureka作为我的表单,但我正面临一个问题。我安装使用这些代码尤里卡:无法转换'BaseRow'类型的值?指定类型'CustomPushRow?'
form +++ Section("Add Event")
<<< TextRow("Event"){ row in
row.title = "Event"
row.placeholder = "Enter Event Name Here"
}
<<< DateRow("Date"){
$0.title = "Date"
$0.value = selectedDate
}
<<< TimeRow("Time"){
$0.title = "Time"
$0.value = selectedDate
}
let locationSearchTable = storyboard!.instantiateViewController(withIdentifier: "eventLocation") as! EventLocationViewController
form +++ Section("Location")
<<< CustomPushRow<EventLocationViewController>(){
$0.title = "Location"
$0.presentationMode = .segueName(segueName: "eventLocation" ,controllerProvider: locationSearchTable, onDismiss: nil)
}
这里自定义推行类的形式
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 }
}, onDismiss: { vc in
print("On Dimiss")
_ = vc.navigationController?.popViewController(animated: true)
})
}
}
,当我想改变我用表格的值,此方法来改变
let eventName : TextRow? = form.rowBy(tag:"Event")
eventName?.value = "asdasadsds"
但是当我想更改自定义推送行时,我遇到此问题无法转换类型'BaseRow?'的值?指定类型'CustomPushRow?'当我这样做
let row : CustomPushRow? = form.rowBy(tag: "Location")
我怎样才能改变的CustomPushRow