Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eureka Forms Library responding to a row's textfield finishing editing?

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

like image 951
Andrew Kinnie Avatar asked Feb 19 '16 20:02

Andrew Kinnie


2 Answers

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

like image 124
Paul Lehn Avatar answered Oct 05 '22 07:10

Paul Lehn


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.

like image 42
user3545708 Avatar answered Oct 05 '22 06:10

user3545708