How to detect when user used Password AutoFill on a UITextField

前端 未结 7 2179
半阙折子戏
半阙折子戏 2020-12-10 03:26

I\'ve implemented all the app and server changes necessary to support Password Autofill on iOS 11, and it works well. I\'d like it to work a little better.

My usern

7条回答
  •  醉酒成梦
    2020-12-10 04:03

    I don't think there is a better solution.

    One thing I noticed is that autofill is only enabled when the text field is empty.

    So if the text field went from empty to a length greater than the minimum password/username, then it is most likely autofill/paste.

    I am using shouldChangeCharactersIn to detect the change in the UITextField. I'm not for sure if there is a case where text from the keyboard could be batched together before the delegate method is called.

提交回复
热议问题