パスワードの自動入力 iOS 11 から、UITextField や UITextView に対して ユーザ名 や パスワード を自動入力できるようになりました。 今回はこの機能の実装方法をご紹介します。 適切な Content Type の指定 UITextField や UITextView は textContentType プロパティを持っています。 このプロパティは UITextContentType という構造体ですが、iOS 11 ではこの構造体に以下の 2 つの定数が追加されました。 username password Password AutoFill を使用するためには textContentType にこれらを指定する必要があります。 usernameField.textContentType = .username passwordField.textContent