3

I have a custom button in ABNewPersonViewController. I need to enable the button, only if any(at least) one of the fields in ABNewPersonViewController is edited. Is there any way in which I can check this condition, other than writing code to check all fields independently.

Xavi Valero
  • 2,047
  • 7
  • 42
  • 80

2 Answers2

1

You'll need some code somewhere to do this, but I'd do it by coding the existing event listener on each field to enable the button when the field being listened to is edited.

Chris Gerken
  • 16,221
  • 6
  • 44
  • 59
1

All controls have events so you can link your code to it. Example: UITextField has the event Editing Did Begin. Every controls can be linked to the same IBAction and you can recognize wich control the user changed by checking the sender param.

Giuseppe Mosca
  • 1,323
  • 12
  • 18