How can i get writing language of uitextview? or how can i know uitextview is right to left or left to right in current state?
Asked
Active
Viewed 384 times
2
-
Those are two entirely different questions. What exactly do you want to know? – JustSid Nov 17 '12 at 19:00
-
it's not important, any answer... – Arash Zeinoddini Nov 17 '12 at 19:04
3 Answers
2
[textView baseWritingDirectionForPosition:[textView beginningOfDocument] inDirection:UITextStorageDirectionForward] == UITextWritingDirectionRightToLeft
Should return true if the UITextView
is right-to-left, and false otherwise.
Further documentation can be found here, if you need it!

username tbd
- 9,152
- 1
- 20
- 35
1
In answer to your other question, you can get the keyboard language used from UITextInputMode
docs: http://developer.apple.com/library/ios/#documentation/uikit/reference/UITextInputMode_Class/Reference/Reference.html

Madivad
- 2,999
- 7
- 33
- 60
-
thanks Madivad, it's good answer, i thought method like this dosent exist in iOS sdk :) – Arash Zeinoddini Nov 19 '12 at 21:14
0
This solution worked better for me
[NSLocale characterDirectionForLanguage:self.textView.textInputMode.primaryLanguage] == NSLocaleLanguageDirectionRightToLeft

Yossi
- 2,525
- 2
- 21
- 24