ios - Programmatically press a keyboard button -
i wondering if there way open ios keyboard , programmatically press button without interacting keyboard itself.
yes, there way. there several ways of them undocumented , should not used them in production.
generating tap means generating uievent
(several of them, actually) , passing uiapplication.sendevent(_:)
.
unfortunately, uievent
inner structure undocumented people have inspected , can google tools synthesize events (e.g. https://github.com/n00neimp0rtant/controlfreak). note internal structure of uievent
, uitouch
can change between ios versions (see ios 9 uievent)
you can use internal uiautomation api (see example these generated headers) generate tap (that's ui tests using in previous releases) again, api not publicly documented , loaded app if app connected xcode. not sure how private framework looks on ios 9.
Comments
Post a Comment