2

I'm trying to make my text field show only Arabic numbers keyboard, no matter what language the device have. I changed the app base language to Arabic and it is still showing me English numbers.

keyboardImage

0

1 Answer 1

3

You can create a subclass like ArabicTextField of UITextField and use textInputMode property to change your keyboard as below

class ArabicTextField: UITextField {
    override var textInputMode: UITextInputMode? {
        UITextInputMode.activeInputModes.filter
        { $0.primaryLanguage == "ar" }.first ?? super.textInputMode } 
}
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.