title: UITextField, textRect, Xcode Version 10.0, Deployment Target 12.0, Swift 4.2
body: <p>I was using this code scope previously:</p>
  
  <pre><code>override func textRect(forBounds bounds: CGRect) -&gt; CGRect {
      super.textRect(forBounds: bounds)
      return UIEdgeInsetsInsetRect(bounds, UIEdgeInsets(top: 0,left: 10, bottom: 0, right: 10))
  }
  </code></pre>
  
  <p>But it gives an error after Xcode, Swift Update. Here is an error:</p>
  
  <pre><code>'UIEdgeInsetsInsetRect' has been replaced by instance method 'CGRect.inset(by:)'
  </code></pre>
  
  <p>And then i wrote this:</p>
  
  <pre><code>override func textRect(forBounds bounds: CGRect) -&gt; CGRect {
      super.textRect(forBounds: bounds)
      var animationRect = frame.inset(by: UIEdgeInsets(top: 0, left: 5, bottom: 0, right: 10))
      return animationRect
  }
  </code></pre>
  
  <p>But the above code doesn't affect into the text field. What should I write to give a padding from left? </p>