title: UITextView Right Alignment in swift
body: <p>i am trying text enter in <strong>textview</strong> right to left alignment but at that time textview starting position enter space not taking textview in swift</p>
  <p>@IBOutlet weak var textview: UITextView!
  @IBOutlet weak var sampleTF: UITextField!</p>
  <pre><code>override func viewDidLoad() {
      super.viewDidLoad()
      textview.textAlignment = .right
      textview.isScrollEnabled = true
      textview.heightAnchor.constraint(equalToConstant: 52.0).isActive = true
      textview.delegate = self
      
  }
  
  @IBAction func sampleButton(_ sender: Any) {
   
      
  }
  
  func textViewDidChange(_ textView: UITextView) {
      let size = CGSize(width: textView.frame.width, height: 200)
      let estimateSize = textView.sizeThatFits(size)
      
      guard textView.contentSize.height &lt; 100.0 else { textview.isScrollEnabled = true; return}
      
      textview.isScrollEnabled = false
      textview.constraints.forEach { (constriant) in
          if constriant.firstAttribute == .height {
              constriant.constant = estimateSize.height
          }
      }
  }
  </code></pre>