0

I have a custom keyboard extension and its containing app. After launching, containing app send to my extension a number every 2 seconds. I catch it and output to the text field. But I have a problem. When extension keyboard appears on a screen - it starts to receive numbers. But when it disappears it still receive numbers.

Question: how to stop receiving numbers when my extension is hidden?

Edit: I run my extension receiver in an infinite loop. How to exit this loop if keyboard is hidden?

veitr
  • 111
  • 10

1 Answers1

0

Not sure if this is exactly what you're looking for, but you could check the keyboard height to see if you should be sending numbers to the keyboard using UIKeyboardFrameEndUserInfoKey. If it's zero, you're hidden. You can also check your overall height in the keyboard extension and decide if you should parse the data you're sending.

stewjacks
  • 471
  • 6
  • 12