3 Replies
      Latest reply on Jan 14, 2020 1:13 AM by Claude31
      ayumi_beginner Level 1 Level 1 (0 points)

        Hi.

        I am using "UITextInputMode" to fix the language mode.

        But "UITextInputMode" doesn't work on IOS13.1.

        "UITextInputMode" works until "IOS13.0".

        Please tell me the workaround.

        Is this an OS-dependent bug?

         

            override var textInputMode: UITextInputMode? {
                if toriTapp {
                    if let language = getKeyboardLanguage() {
                        toriTapp = false
        
        
                        for tim in UITextInputMode.activeInputModes {
                            if tim.primaryLanguage!.contains(language) {
                                return tim
                            }
                        }
                    }
                    return super.textInputMode
                }
                return super.textInputMode
            }
        
        
            private func getKeyboardLanguage() -> String? {
                return "en"
            }
        
        
        • Re: "UITextInputMode" doesn't work on IOS13.1
          Claude31 Level 8 Level 8 (7,845 points)

          "UITextInputMode" doesn't work on IOS13.1.

           

          What do you get ? Error message ? Wrong result ?

          What did you expect ?

           

          Have you checked

               UITextInputMode.activeInputModes

          is not empty ?

            • Re: "UITextInputMode" doesn't work on IOS13.1
              ayumi_beginner Level 1 Level 1 (0 points)

              Thank you for your comment.

               

              >"UITextInputMode" doesn't work on IOS13.1.

              >What did you expect ?

              I expect fixed language mode.

              Is there a way to fix the mode on IOS13.1?

               

              It does not raise any error messages.

              Primary language is available for "en-US".

              And "return tim" appears to be working properly.

              But, it will not be in "en-US" mode.

                • Re: "UITextInputMode" doesn't work on IOS13.1
                  Claude31 Level 8 Level 8 (7,845 points)

                  Could you add some prints to understand what happens:

                   

                      override var textInputMode: UITextInputMode? {
                          if toriTapp {
                              if let language = getKeyboardLanguage() {
                                  toriTapp = false
                                  print("language", language)
                  
                                  for tim in UITextInputMode.activeInputModes {
                                      if tim.primaryLanguage!.contains(language) {
                                          print("tim", tim)
                                          return tim
                                      }
                                  }
                              }
                              return super.textInputMode
                          }
                          return super.textInputMode
                      }

                   

                  Please tell what you get on log.

                  - for iOS 13.1

                  - for iOS 13.0