禁用iOS键盘上的重音字符

时间:2016-08-31 01:41:44

标签: ios swift xcode non-ascii-characters

我正在使用swift进行编码,当用户长按该角色时,我想在iOS设备上禁用重音键盘。

我不想在“设置”中按照代码执行此操作。

我不知道之前是否讨论过这个话题。

谢谢

enter image description here

更新

我在ShouldChangeCharacterInRange方法中有流动的代码

public func textField(textField: UITextField, shouldChangeCharactersInRange range: NSRange, replacementString string: String) -> Bool 
{ 
 let xField = fieldBy(textField.tag)! 
 let editedString = textField.text!.replace(range, with: string) 
 let isLengthValid = !xField.isBeyondLimit(editedString) 
 if isLengthValid { 
  xField.validate(editedString) 
 } 
return isLengthValid 
} 

0 个答案:

没有答案