Andrew Kinnie
Andrew Kinnie

Reputation: 297

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

Upvotes: 6

Views: 1530

Answers (2)

Paul Lehn
Paul Lehn

Reputation: 3342

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

Upvotes: 8

user3545708
user3545708

Reputation: 86

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.

Upvotes: 3

Related Questions