             let unformattedText = value ?? ""
             let formattedText = self.formattedText(fromText: unformattedText, textMask: textMask, cursorPosition: &cursorPosition)
             if formattedText.characters.count > 0 || value != nil {
-                self.formattedText = formattedText
+                text = formattedText
             } else {
-                self.formattedText = nil
+                text = nil
             }
             placeholderLabel.isHidden = (unformattedText.characters.count > 0)
         }


import UIKit

open class FormattedTextField: UITextField {
    open static let maskSymbol: Character = "×"


    private func commonInit() {
        delegateProxy.delegate = super.delegate
        super.delegate = delegateProxy

        if let unformattedText = unformattedText {
            var cursorPosition = 0
            text = formattedText(fromText: unformattedText, textMask: text, cursorPosition: &cursorPosition)
        }

        placeholderLabel.font = font
        placeholderLabel.textColor = UIColor(white: 170/255.0, alpha: 0.5)
