I will go with solution provided by "amedvedev" as class Names are more reliable in iOS. But as said it works only on Simulator.
!driver.findElements(MobileBy.className("UIAKeyboard")).isEmpty();
OR
!driver.findElements(By.className("UIAKeyboard")).isEmpty();
isEmpty() is important other wise method will throw exception and test execution will break.