     }
 
     
-    func textFieldDidBeginEditing(textField: UITextField) {
-        clearError()
-        let isResp = isFirstResponder()
-        showTitle(isResp)
-        if originalPlaceHolderText == nil {
-            originalPlaceHolderText = placeholder!
-        }
-        placeholder = ""
-    }
-    
-
-    func textFieldDidEndEditing(textField: UITextField) {
-        placeholder = originalPlaceHolderText
-        handleRules()
-    }
-
-    func handleRules() {
-        // Check required field rule
-        if isRequired {
-            if text.isEmpty {
-                setRequiredError()
-                return
-            }
-        }
-        // Check if its a email field
-        if isEmail && !text.isEmail() {
-            setEmailError()
-            return
-        }
-
-        // check all the custom validators
-
-        for (message,validator) in validators {
-            if (validator as? (() -> Bool) != nil) {
-                hasError = !(validator as () -> Bool)()
-                if hasError {
-                    setCustomError(message)
-                    return
-                }
-            }
-        }
-
-        let isResp = isFirstResponder()
-        if hasError {
-            showTitle(isResp)
-        }else {
-            clearError()
-        }
-    }
+
 
 
     // MARK:- Overrides

        title.frame = CGRect(x: x, y: title.frame.origin.y, width: frame.size.width, height: title.frame.size.height)
    }

    func showTitle(animated: Bool) {
        let dur = animated ? animationDuration : 0
        UIView.animateWithDuration(dur, delay: 0, options: UIViewAnimationOptions.BeginFromCurrentState | UIViewAnimationOptions.CurveEaseOut, animations: {
            // Animation

    }


     func textFieldDidBeginEditing(textField: UITextField) {
        clearError()
        let isResp = isFirstResponder()
        showTitle(isResp)
        if originalPlaceHolderText == nil {
            originalPlaceHolderText = placeholder!
        }
        placeholder = ""
    }


    func textFieldDidEndEditing(textField: UITextField) {
        placeholder = originalPlaceHolderText
        validateAllRules()
    }

    private func validateAllRules() {
        // Check required field rule
        if isRequired {
            if text.isEmpty {
                setRequiredError()
                return
            }
        }
        // Check if its a email field
        if isEmail && !text.isEmail() {
            setEmailError()
            return
        }

        // check all the custom validators

        for (message,validator) in validators {
            if (validator as? (() -> Bool) != nil) {
                hasError = !(validator as () -> Bool)()
                if hasError {
                    setCustomError(message)
                    return
                }
            }
        }

        let isResp = isFirstResponder()
        if hasError {
            showTitle(isResp)
        }else {
            clearError()
        }
    }


    private func setRequiredError () {
        if let fieldName = placeholder {
            title.text = "\(fieldName) can't be blank"
