Without Eureka, one would implement the UITextFieldDelegate.textFieldShouldReturn() delegate function to perform an action directly from the keyboard. It looks like Eureka already implements this function and simply ends editing without letting me execute my own code at this moment.
How would I go and implement this using Eureka without requiring people to tap a ButtonRow?
Problem solved. After doing some code rereading and finally realizing that FormViewController actually implements UITextFieldDelegate.textFieldShouldReturn() by forwarding execution to its own FormViewController.textInputShouldReturn() function, I could simply override this function. In my case I used the form row tag to determine on which return event to act:
override func textInputShouldReturn<T>(_ textInput: UITextInput, cell: Cell<T>) -> Bool {
if cell.row.tag == "some_tag" {
// action here
}
return super.textInputShouldReturn(textInput, cell: cell)
}
Putting this here in case someone will encounter the same thing, thanks for this library 馃憤
Most helpful comment
Problem solved. After doing some code rereading and finally realizing that FormViewController actually implements
UITextFieldDelegate.textFieldShouldReturn()by forwarding execution to its ownFormViewController.textInputShouldReturn()function, I could simply override this function. In my case I used the form row tag to determine on which return event to act:Putting this here in case someone will encounter the same thing, thanks for this library 馃憤