title: How to limit separator input in Swift UITextField?
body: <p>How do I embed this in a program to limit the input of delimiters in a text field?</p>
  
  <pre><code>func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -&gt; Bool {
      if(string == "," || string == "." ) {
          if ((textField.text?.contains(","))! || (textField.text?.contains("."))!){
              return false
          }
      }
      return true
  }
  </code></pre>