问题
I'd like to enable the "Autofill Password" in my wkwebview. I can't seem to find any documentation or examples online on how to do this.
回答1:
This IS actually doable using 1Password
Steps to implement it in Swift
Add the extension files:
OnePasswordExtension.hOnePasswordExtension.m
Then include them using a bridging header:
#import "OnePasswordExtension.h"
Finally, you can use the following in your project
@IBAction func onePassword_btn(sender: AnyObject) {
OnePasswordExtension.sharedExtension().fillLoginIntoWebView(self.webView, forViewController: self, sender: sender, completion: {(Bool) in
// error handling
})
}
来源:https://stackoverflow.com/questions/27734435/how-do-i-enable-autofill-password-for-a-wkwebview