         self.isValid(text)
         return true
     }
-
+    
     private func isValid(text: String) -> Bool {
         if(regexPattern?.isEmpty == false) {
             let regex = NSRegularExpression(pattern: regexPattern!, options: NSRegularExpressionOptions.CaseInsensitive, error: nil)
             let range = NSMakeRange(0, countElements(text))
             let match = regex?.rangeOfFirstMatchInString(text, options: NSMatchingOptions.ReportProgress, range: range)
-
+            
             if( match?.location != NSNotFound) {
                 self.tintColor = self.validTintColor
                 self.bottomBorderColor = self.validBottomBorderColor


@IBDesignable
class G8MKTextField: MKTextField, UITextFieldDelegate {

    private var regexPattern: String? = nil
    @IBInspectable var regexPatternCustom: String? = nil { //executed for first
        didSet {
            regexPattern = regexPatternCustom
        }
    }
    @IBInspectable var regexPatternEnum: Int = 0 { //executed for second
        didSet {
            if regexPatternEnum != 0 && regexPatterTypes.count > regexPatternEnum {
                regexPattern = (regexPatterTypes[regexPatternEnum] as RegexPatternTypes).rawValue
            }
        }
    }

    @IBInspectable var borderColor: UIColor = UIColor.blackColor() {
        didSet {
            super.layer.borderColor = borderColor.CGColor
        }
    }

    @IBInspectable var defaultBottomBorderColor: UIColor = UIColor.lightGrayColor() {
        didSet {
            super.bottomBorderColor = defaultBottomBorderColor

                return false
            }
        }
        
        self.tintColor = self.defaultTintColor
        self.bottomBorderColor = self.defaultBottomBorderColor
        self.circleLayerColor = self.defaultCircleLayerColor
        return true
    }
    
    func isValid() -> Bool {
        return self.isValid(self.text)
    }
