      */
     open var maxLength: Int {
         get {
-            return formatPattern.characters.count
+            return formatPattern.count
         }
     }
     

        var currentTextForFormatting = ""
        
        if let text = super.text {
            if text.characters.count > 0 {
                currentTextForFormatting = text
            }
        }

            super.text = finalText
            
            if let text = self.text {
                if text.count > self.maxLength {
                    super.text = String(text[text.index(text.startIndex, offsetBy: self.maxLength)])
                }
            }
        }
