How to apply an NSPredicate to a custom XLForm row?

76 views Asked by At

I have a row of type XLFormRowDescriptionTypeSelectorPush

I set row.value to a custom class Agreement and row.addValidator(AgreementValidator())

I want another to be hidden/shown depending upon the value of Agreement.agree (which is "Accepted" or "Declined").

I can't figure out how to do this. Here's where I am so far:

other_row.hidden = NSPredicate(format:"$other_tag.value != "Accepted")

But the value of the other_tag row is Agreement and not a string. How can I compare with Agreement.agree?

1

There are 1 answers

1
Sanu S On BEST ANSWER

Try this.

other_row.hidden = NSPredicate(format: "NOT $other_tag.value.agree != 'Accepted'")