Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

password autofill quicktype bar in ios 11

In ios 11 a new feature is introduced: Password Autofill for app. This feature allows users to use their saved password in their apps directly from the keyboard quicktype bar.

https://techcrunch.com/2017/06/08/ios-11s-new-password-autofill-for-apps-wont-work-with-or-replace-your-favorite-password-manager/

https://code.tutsplus.com/articles/faster-logins-with-password-autofill-in-ios-11--cms-29096

https://developer.apple.com/videos/play/wwdc2017/206/

But the problem is when I use keyboardWillShow or keyboardWillHide or keyboardDidShow or keyboardDidHide events none of them consider the quickbar height for keyboardSize.

- (void)keyboardWillShow:(NSNotification *)notification {
    NSDictionary* info = [notification userInfo];
    CGSize keyboardSize = [info[UIKeyboardFrameBeginUserInfoKey] CGRectValue].size;
}

keyboardSize would be the previous keyboardSize so if we had the quickbar and now it is disappeared it keyboardSize is more than it should be and vice versa. It seems that keyboardWillShow notification fires before the quickbar show/hide.

If anybody has any idea how to fire keyboard notifications after quickbar show/hide or any other suggestion, please share.

Thanks..

like image 791
Besat Avatar asked Aug 08 '17 13:08

Besat


2 Answers

try to useUIKeyboardFrameEndUserInfoKey dont UIKeyboardFrameBeginUserInfoKey

like image 151
Shubham bairagi Avatar answered Oct 23 '22 16:10

Shubham bairagi


I think you're using the wrong key

try UIKeyboardFrameEndUserInfoKey

Objective c

CGSize keyboardSize = [info[UIKeyboardFrameEndUserInfoKey] CGRectValue].size;

Swift

let keyboardSize = (info[UIKeyboardFrameEndUserInfoKey] as! NSValue).cgRectValue
like image 33
zombie Avatar answered Oct 23 '22 16:10

zombie