[WIP] Quotes

This commit is contained in:
Ali
2023-10-07 00:33:12 +04:00
parent 3cada5996b
commit eae866c77e
77 changed files with 2103 additions and 552 deletions

View File

@@ -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
}
}
}