             
             if self.validationType! == .Email {
                 
-                var isValid = self.emailValidationBlock(text: self.text, message: &message)
+                let isValid = self.emailValidationBlock(text: self.text!, message: &message)
                 
                 performValidation(isValid,message: message)
                 
             } else {
-                var isValid = self.numberValidationBlock(text: self.text, message: &message)
+                let isValid = self.numberValidationBlock(text: self.text!, message: &message)
                 
                 performValidation(isValid,message: message)
             }
         }
     }
-    
-    
 }
 
 extension EGFloatingTextField {

import Foundation
import PureLayout


public enum EGFloatingTextFieldValidationType {
    case Email
    case Number
}

public class EGFloatingTextField: UITextField {
    
    
    private typealias EGFloatingTextFieldValidationBlock = ((text:String,inout message:String)-> Bool)!
    
    public var validationType : EGFloatingTextFieldValidationType!
    
    
    private var emailValidationBlock  : EGFloatingTextFieldValidationBlock
    private var numberValidationBlock : EGFloatingTextFieldValidationBlock
    
    
    let kDefaultInactiveColor = UIColor(white: CGFloat(0), alpha: CGFloat(0.54))
    let kDefaultActiveColor = UIColor.blueColor()

    let kDefaultLineHeight = CGFloat(22)
    let kDefaultLabelTextColor = UIColor(white: CGFloat(0), alpha: CGFloat(0.54))
    
    public var floatingLabel : Bool! = true
    var label : UILabel!
    var labelFont : UIFont!
    var labelTextColor : UIColor!
