Disable accented character on iOS keyboard
<p>I'm using swift to code and I'd like to disable the accented keyboard on iOS device when the user long presses on the character.</p>

<p>I dont want to do that in the Settings but by code.</p>

<p>I don't know if this topic has been discussed before.</p>

<p>Thank you</p>

<p><a href="https://i.stack.imgur.com/5X4th.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5X4th.png" alt="enter image description here"></a></p>

<p><strong>UPDATE:</strong></p>

<p>I have flowing code in ShouldChangeCharacterInRange method </p>

<pre><code>public func textField(textField: UITextField, shouldChangeCharactersInRange range: NSRange, replacementString string: String) -&gt; 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 
} 
</code></pre>