Search code examples
swiftwkwebviewkeychainautofill

How to use autoFill with keychain access in WKWebView


In i0S 11.0 introduce username and password autofill in apps but I found post on reddit that it is possible to use it also in WKWebView but couldn't find any description how to use it, how to let WKWebView that that specific inputView is this for password and username and display autoFill above the keyboard


Solution

  • Almost sure this has been answered elsewhere, but Enabling Password AutoFill on an HTML Input Element from Apple's docs is what you need.

    TL;DR:

    <input id="user-text-field" type="email" autocomplete="username"/>
    <input id="password-text-field" type="password" autocomplete="current-password"/>