title: Swift UITextField icon position set
body: <p>Add Icon in UITextField using </p>
  
  <pre><code>var leftImageView = UIImageView()
  leftImageView.image = leftImage
  textField.leftView = leftImageView
  textField.leftViewMode = UITextFieldViewMode.Always
  leftImageView.frame = CGRectMake(15, 10, 15, 20)
  textField.addSubview(leftImageView)
  </code></pre>
  
  <p>o/p for this<a href="https://i.stack.imgur.com/mKwo4.png" rel="noreferrer"><img src="https://i.stack.imgur.com/mKwo4.png" alt="Image is close to textfield border"></a></p>
  
  <p>I found solution like remove this code from above code</p>
  
  <pre><code>textField.leftView = leftImageView
  </code></pre>
  
  <p>It give icon alignment proper but whenever start editing text field text on icon like this <a href="https://i.stack.imgur.com/2il7l.png" rel="noreferrer"><img src="https://i.stack.imgur.com/2il7l.png" alt="enter image description here"></a></p>
  
  <p>I want o/p like this </p>
  
  <p><a href="https://i.stack.imgur.com/y2h0j.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/y2h0j.jpg" alt="enter image description here"></a></p>