Password field's keyboard switches from azerty to qwerty (sometimes) only on iOS 12

前端 未结 4 1066
礼貌的吻别
礼貌的吻别 2020-12-19 12:03

I code an iOS App in Swift 4, I\'m french so I work with mobile phone in french language/french region.

With an iOS 12 device, my password

4条回答
  •  无人及你
    2020-12-19 12:50

    Same Issue here: https://github.com/xlbs-rm/ios-demo

    Filled a Bug Report here: https://feedbackassistant.apple.com/ Date 2020-07-31

    No Reaction from Apple yet Issue on iOS 13.5.1, 13.7, 12.4.3 Issue on Connected Device (Debugging), Simulator, TestFlight Alpha Builds (for iTunesConnect Users), TestFlight Beta Builds (Apple Approved TestFlight Builds)

    Only Solution is remove the 2nd Password Field!

    Idea #2 textContentType = .oneTimeCode suggested here: https://stackoverflow.com/a/53760545

    if #available(iOS 12.0, *) {
        tfPassword.textContentType = .oneTimeCode
    }
    
    • not working
    • not removing the warning "Cannot show Automatic Strong Passwords for app..."

    Idea #3 remove CFBundleDevelopmentRegion

    • not working

    Idea #4 entend UITextField, override textInputMode return one with the correct lang similar to here: https://stackoverflow.com/a/52701639

    • not working

    Solution:

    if #available(iOS 12.0, *) {
        passInput.textContentType = .newPassword
    }
    

    Implement: UITextFieldDelegate

    public func textFieldDidBeginEditing(_ textField: UITextField) {
        if exchangeResponder == false {
          exchangeResponder = true
          firstnameInput.becomeFirstResponder()
          textField.becomeFirstResponder()
          exchangeResponder = false
        }
    }
    
    passInput.delegate = self
    pass2Input.delegate = self
    

    Now I can move between all fields and have everytime the German keyboard!

提交回复
热议问题