1

I have three textfields with 1,2,3 tags respectively. After pressing a button how do I get the textfield which has focus on.

For instance, I am tying in textfield tag 1 and then press a button, how do I determine if I am on textfield tag 1

Alex
  • 105
  • 1
  • 5
  • Swift answer: https://stackoverflow.com/a/27140764/3151675 – Tamás Sengel Feb 16 '18 at 20:05
  • No, it is not possible duplicate. I'm just trying to use textfields not having issues over API – Alex Feb 16 '18 at 20:07
  • Please read the duplicate I’ve provided. It addresses the same issue you’re facing. – Tamás Sengel Feb 16 '18 at 20:08
  • Just check which textfield is the first responder and you are done. And this is definitely a duplicate. – SWAT Feb 16 '18 at 20:29
  • 1
    If you are "pressing a button", wouldn't *that* button have the focus? Maybe if you provide some code (and maybe a tag on if it's macOS or iOS) it would clarify things. "Focus" is generally not an iOS term - and in macOS while you "press" a button the focus is on the button pressed. So if you are actually asking asking which textfield is the first responder, well, yes this *is* a duplicate. –  Feb 16 '18 at 20:29
  • Hi @Alex, what have you tried so far? Can you include a code snippet? – Max von Hippel Feb 16 '18 at 20:44
  • Lack of relevant tags – El Tomato Feb 17 '18 at 03:27

0 Answers0