S.Boy S.Boy - 5 months ago 42
Swift Question

How to check whether the keyboard is shown or not?

I'm using

for automated UI testing on an iOS project. I want to check whether the keyboard is shown or not after swiping away on the screen.

I've seen the header file in
framework named GREYKeyboard.h with a function named
with a bool return value. This would be very helpful for me, but I don't know how to use it since I have no access to this API.

is installed with

Answer Source

I've found the solution. You can access to GREYKeyboard.h (which is a private header) by editing the module.modulemap file. Add the

header "../PrivateHeaders/GREYKeyboard.h"

line to the file. The module.modulemap file should look like this after editing:

 framework module EarlGrey {
  umbrella header "EarlGrey.h"

  header "../PrivateHeaders/GREYKeyboard.h"
  export *
  module * { export * }
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download