title: Swift - UITextField padding hides the clear button
body: <p>I have created a special textField that has a padding on the right hand side (I am using RTL language). It works great, except for the fact it hides the clear button. Any ideas how I can present the clear button on top of the padding view?</p>
  
  <pre><code>class PaddedTextField: UITextField {
  
      let padding = UIEdgeInsets(top: 0, left: 5, bottom: 0, right: 5);
  
      override func textRect(forBounds bounds: CGRect) -&gt; CGRect {
          return UIEdgeInsetsInsetRect(bounds, padding)
      }
  
      override func placeholderRect(forBounds bounds: CGRect) -&gt; CGRect {
          return UIEdgeInsetsInsetRect(bounds, padding)
      }
  
      override func editingRect(forBounds bounds: CGRect) -&gt; CGRect {
          return UIEdgeInsetsInsetRect(bounds, padding)
      }
  }
  </code></pre>