iOS unit test: How to set/update/examine firstResponder?

后端 未结 3 1771
故里飘歌
故里飘歌 2020-12-29 07:14

How do you write first responder unit tests?

I\'m trying to write a test to confirm that a method advances focus to the next text field. controller is a

3条回答
  •  北海茫月
    2020-12-29 07:35

    You need to ensure the textField is installed in the view hierarchy.

    If the view’s window property holds a UIWindow object, it has been installed in a view hierarchy; if it returns nil, the view is detached from any hierarchy.

    Hopefully this helps....

提交回复
热议问题