I am trying to remove the Arabic text diacritic. For example I need to convert this َب
to this ب
, here is my code :
if (text != "") {
for char in text! {
print(char)
print(char.unicodeScalars.first?.value)
if allowed.contains("\(char)"){
newText.append(char)
}
}
self.textView.text = text!
} else {
// TODO :
// show an alert
print("uhhh no way")
}
I have tried these solutions but with no luck :