title: how can I add a permanent character at the beginning of an input field in uiAlert Popup?
body: <p>When user presses a button in my app I show him the alert view with an input text field there. I use the following code for that:</p>
  
  <pre><code>func addTapped(sender: UIBarButtonItem) {
  
      let alertController = UIAlertController(title: "", message: "Write a #name of a tag that you want to follow", preferredStyle: .Alert)
  
      let confirmAction = UIAlertAction(title: "Confirm", style: .Default) { (_) in
          if let field = alertController.textFields![0] as? UITextField {
  
              if(field.text?.characters.count &gt; 0) {
                  print("user put some data inside")
              } else {
                  print("user did not put anything")
              }
  
          } else {
              // user did not fill field
  
          }
      }
  
      let cancelAction = UIAlertAction(title: "Cancel", style: .Cancel) { (_) in }
  
      alertController.addTextFieldWithConfigurationHandler { (textField) in
          let attributedString = NSMutableAttributedString(string: "C-TAD-")
          attributedString.addAttribute(NSForegroundColorAttributeName, value: UIColor.lightGrayColor(), range: NSMakeRange(0,6))
          textField.attributedText = attributedString
      }
  
      alertController.addAction(confirmAction)
      alertController.addAction(cancelAction)
  
      self.presentViewController(alertController, animated: true, completion: nil)
  
  }
  </code></pre>
  
  <p>It works well, when user runs the app he sees:</p>
  
  <p><a href="https://i.stack.imgur.com/V6821.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/V6821.png" alt="enter image description here"></a></p>
  
  <p>but this placeholder text inside is removable. I would like to prevent that and always show this text there, so basically lock the delete option on it.</p>
  
  <p>How can I lock the possibility of removing those first letters?</p>