mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
[WIP] Quotes
This commit is contained in:
@@ -48,4 +48,20 @@ public extension UITextView {
|
||||
}
|
||||
return numberOfLines
|
||||
}
|
||||
|
||||
var isRTL: Bool {
|
||||
if let text = self.text, !text.isEmpty {
|
||||
let tagger = NSLinguisticTagger(tagSchemes: [.language], options: 0)
|
||||
tagger.string = text
|
||||
|
||||
let lang = tagger.tag(at: 0, scheme: .language, tokenRange: nil, sentenceRange: nil)
|
||||
if let lang = lang?.rawValue, lang.contains("he") || lang.contains("ar") || lang.contains("fa") {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user