         validators[message] = condtion
     }
 
+    func validate() -> Bool {
+        validateAllRules()
+        return hasError
+    }
+
 }

@IBDesignable class FloatLabelTextField: UITextField,UITextFieldDelegate {
    let animationDuration = 0.3
    var title = UILabel()
    var hasError = false
    private var hasShownError = false
    private var originalPlaceHolderText: String?
    private var validators =  [String: Any]()


    }

    private func clearError() {
        title.text = self.placeholder!
        title.textColor = titleTextColour
        title.font = self.font
