6

We are evaluating Eureka Forms, and have created a simple form with a couple FieldRows. I see how you can get all the values out of a form, and how you can respond when any row is changed at all using onChange() (on a character by character basis) but it is not obvious to me how one responds to a field's editing finishing completely, rather than as each character is typed.

In a normal textfield, we could set the view controller or the cell of a tableview to be the textfield's delegate and respond to textField:didFinishEditing: and handle it there.

How does one do that with a Eureka Forms field row?

Thanks

Isuru
  • 30,617
  • 60
  • 187
  • 303
Andrew Kinnie
  • 277
  • 6
  • 17

2 Answers2

8

just to add to the answer here, I ended up using

        .onCellHighlightChanged({ (cell, row) in
            if row.isHighlighted == false {
                self.updateUser()
            }
        })

and then just checking if the cell isHighlighted or not.

This was using Eureka 4.0

Paul Lehn
  • 3,202
  • 1
  • 24
  • 29
3

You can use the onCellUnHighlight callback, just like the onChange. The OnCellUnHighlight gets called when the row resigns firstResponder which is when you stop editing.

Note: Because of the default implementation you may have to define onCellHighlight as well because it will override your onCellUnHighlight if you do not.

  • Seems to work, though I did need to implement onCellHighlight as well, as you suggested. I just added an empty implementation, so I am not sure if there I should do there, but it seems to do what I want at the moment. Thanks! – Andrew Kinnie Feb 21 '16 at 21:06