 
     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
     }

        self.textColor = UIColor.blackColor()

        self.setNeedsDisplay()
    }

    override func textRectForBounds(bounds: CGRect) -> CGRect {

//

import UIKit
import SVGKit

enum ValidationState: String {
    case Loading = "circ_normal.svg"
    case Error = "x_red.svg"
    case OK = "check_green.svg"

    var imageView: UIImageView {
        return UIImageView(image: SVGKImage(named: self.rawValue).UIImage)
    }
}

class ElloTextField: UITextField {
    private var validationState: ValidationState?

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