             return status.rawValue
         }
         set {
-            status = ControlStatus(rawValue: newValue) ?? .None
+            status = ControlStatus(rawValue: newValue) ?? .Normal
         }
     }
 
+    // MARK: - Computed variables
+    
+    var messageColor: UIColor {
+        return status.color
+    }
+    
+    var borderStatus: ControlStatus {
+        return status == .Normal && editing ? .Editing : status
+    }
+    
+    // MARK: - Private variables
+    
+    private var externalDelegate: UITextFieldDelegate?
+    
+    private var isPlaceholderAtTitle: Bool {
+        return text?.characters.count > 0
+    }
+    
+    private var statusTextFieldNibView: StatusTextFieldNibView? {
+        return contentView as? StatusTextFieldNibView
+    }
+    
     // MARK: - Init
 
     override func commonInit() {
         super.commonInit()
         statusTextFieldNibView?.titleLabel?.text = nil
         message = nil
-        status = .None
+        status = .Normal
         super.delegate = self
     }
     


    override func updateView() {
        super.updateView()
        statusTextFieldNibView?.iconView?.hidden = status == .None
        statusTextFieldNibView?.iconView?.tintColor = status.color
        var borderStatus = status
        if borderStatus == .None && editing {
            borderStatus = .Editing
        }
        statusTextFieldNibView?.borderView?.backgroundColor = borderStatus.color
        statusTextFieldNibView?.messageLabel?.textColor = status.color
        // TODO: Animate:
        if isPlaceholderAtTitle {
            statusTextFieldNibView?.titleLabel?.text = super.placeholder
        } else {
            statusTextFieldNibView?.titleLabel?.text = " " // Needs some text for AutoLayout positioning.
        }
    }



    override var placeholder: String? {
        get {
            return isPlaceholderAtTitle && title == nil ? nil : super.placeholder
        }
        set {
            super.placeholder = newValue
        }
    }
    
}

private extension StatusTextField.ControlStatus {
    
    var color: UIColor {
        switch self {
        case .Normal: return UIColor.grayColor()
        case .Editing: return UIColor(red: 255.0, green: 200.0, blue: 0.0, alpha: 1.0)
        case .Success: return UIColor.greenColor()
        case .Warning: return UIColor.orangeColor()
        case .Error: return UIColor.redColor()
        }
    }
    
