title: How to add space between UITextField Placeholder characters?
body: <p>I want to add Space between <code>UITextField</code> <code>placeHolder</code> Text.</p>
  
  <pre><code>func setTextFieldCharacterSpacing(txtField: TextFieldCustomize) {
      let attributedString = NSMutableAttributedString(string: txtField.text!)
      attributedString.addAttribute(NSAttributedStringKey.kern, value: CGFloat(8.0), range: NSRange(location: 0, length: attributedString.length))
      txtField.attributedText = attributedString
  }
  </code></pre>
  
  <p><strong>Edit 1</strong></p>
  
  <p>I have done this by using <code>textField</code> <code>delegate</code> method as below.</p>
  
  <pre><code>extension LoginVC: UITextFieldDelegate {
      func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -&gt; Bool {
          CommonHelper.sharedInstance.setTextFieldCharacterSpacing(txtField: textField as! TextFieldCustomize)
          return true
      }
  }
  </code></pre>
  
  <p><strong>Edit 2</strong></p>
  
  <p>I have 1 <code>textField</code> with secure entry. when I type anything in that <code>textField</code>, <code>txtField.attributedText</code>space between characters not applied.</p>
  
  <p><strong>Without Secure Field</strong>
  <a href="https://i.stack.imgur.com/fK6Sh.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fK6Sh.gif" alt="enter image description here"></a></p>
  
  <p><strong>With Secure Field</strong></p>
  
  <p><a href="https://i.stack.imgur.com/8Yeoc.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8Yeoc.gif" alt="enter image description here"></a></p>
  
  <p>This works for <code>Username</code> but not for <code>password</code> secure field.</p>
  
  <p>how to add space between characters in secure entry <code>textField</code>?</p>
  
  <p>Thanks in advance.</p>