     func commonInit(){
         
         self.emailValidationBlock = ({(text:String, inout message: String) -> Bool in
-            var emailRegex = "[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,6}"
-            
-            var emailTest = NSPredicate(format:"SELF MATCHES %@" , emailRegex)
-            
-            var  isValid = emailTest.evaluateWithObject(text)
+            let emailRegex = "[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,6}"
+            
+            let emailTest = NSPredicate(format:"SELF MATCHES %@" , emailRegex)
+            
+            let  isValid = emailTest.evaluateWithObject(text)
             if !isValid {
                 message = "Invalid Email Address"
             }
             return isValid;
         })
         self.numberValidationBlock = ({(text:String,inout message: String) -> Bool in
-            var numRegex = "[0-9.+-]+";
-            var numTest = NSPredicate(format:"SELF MATCHES %@" , numRegex)
-            
-            var isValid =  numTest.evaluateWithObject(text)
+            let numRegex = "[0-9.+-]+";
+            let numTest = NSPredicate(format:"SELF MATCHES %@" , numRegex)
+            
+            let isValid =  numTest.evaluateWithObject(text)
             if !isValid {
                 message = "Invalid Number"
             }

        
        NSNotificationCenter.defaultCenter().addObserver(self, selector: Selector("textDidChange:"), name: "UITextFieldTextDidChangeNotification", object: self)
    }
    public func setPlaceHolder(placeholder:String){
        self.label.text = placeholder
    }
    
    override public func becomeFirstResponder() -> Bool {
        
        var flag:Bool = super.becomeFirstResponder()
        
        if flag {
            
            if self.floatingLabel! {
                
                if !self.floating! || self.text!.isEmpty {
                    self.floatLabelToTop()
                    self.floating = true
                }
            } else {
                self.label.textColor = kDefaultActiveColor
                self.label.layer.opacity = 0
            }
            self.showActiveBorder()
        }
        
        self.active=flag
        return flag
    }
    override public func resignFirstResponder() -> Bool {
        
        var flag:Bool = super.becomeFirstResponder()
        
        if flag {
            
            if self.floatingLabel! {
                
                if self.floating! && self.text!.isEmpty {
                    self.animateLabelBack()
                    self.floating = false
                }
            } else {
                if self.text!.isEmpty {
                    self.label.layer.opacity = 1
                }
            }
            self.label.textColor = kDefaultInactiveColor
            self.showInactiveBorder()
            self.validate()
        }
        self.active = flag
        return flag
        
    }
    
    override public func drawRect(rect: CGRect){
        super.drawRect(rect)
        
        var borderColor = self.hasError! ? kDefaultErrorColor : kDefaultInactiveColor
        
        var textRect = self.textRectForBounds(rect)
        var context = UIGraphicsGetCurrentContext()
        var borderlines : [CGPoint] = [CGPointMake(0, CGRectGetHeight(textRect) - 1),
            CGPointMake(CGRectGetWidth(textRect), CGRectGetHeight(textRect) - 1)]
        
        if  self.enabled  {

        self.clipsToBounds = false
        CATransaction.commit()
    }
    
    func showActiveBorder() {
        
        self.activeBorder.layer.transform = CATransform3DMakeScale(CGFloat(0.01), CGFloat(1.0), 1)
        self.activeBorder.layer.opacity = 1
        CATransaction.begin()
        self.activeBorder.layer.transform = CATransform3DMakeScale(CGFloat(0.01), CGFloat(1.0), 1)
        let anim2 = CABasicAnimation(keyPath: "transform")
        let fromTransform = CATransform3DMakeScale(CGFloat(0.01), CGFloat(1.0), 1)
        let toTransform = CATransform3DMakeScale(CGFloat(1.0), CGFloat(1.0), 1)
        anim2.fromValue = NSValue(CATransform3D: fromTransform)
        anim2.toValue = NSValue(CATransform3D: toTransform)
        anim2.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseOut)
