 
     override func clearButtonRectForBounds(bounds: CGRect) -> CGRect {
         var rect = super.clearButtonRectForBounds(bounds)
+        rect.origin.x -= 10
+        return rect
+    }
+
+    override func rightViewRectForBounds(bounds: CGRect) -> CGRect {
+        var rect = super.rightViewRectForBounds(bounds)
         rect.origin.x -= 10
         return rect
     }

//

import UIKit

class ElloTextField: UITextField {

    required override init(frame: CGRect) {
        super.init(frame: frame)

    }

    func sharedSetup() {
        let center = NSNotificationCenter.defaultCenter()
        center.addObserver(self, selector: Selector("textDidBeginEditing:"), name: UITextFieldTextDidBeginEditingNotification, object: nil)
        center.addObserver(self, selector: Selector("textDidEndEditing:"), name: UITextFieldTextDidEndEditingNotification, object: nil)
