title: Limit the number of characters in two specific textfields
body: <p>I'm trying to limit the number of characters in two specific textfields (there are four in total). I was able to successfully do this for one textfield but not both. The max character limit should be 36 for both. Can anyone help me with this? Below is what I have so far. Note: I'm a novice programmer, so please forgive me if there's an obvious answer to this question. Thanks.</p>
  <pre><code>func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -&gt; Bool {
      let maxLength = 36
      let currentString: NSString = (fullNameTextField.text ?? &quot;&quot;) as NSString
      
      let currentString2: NSString = (occupationTextField.text ?? &quot;&quot;) as NSString
      
      let newString: NSString =
          currentString.replacingCharacters(in: range, with: string) as NSString
      return newString.length &lt;= maxLength
  }
  </code></pre>