     required public init?(coder aDecoder: NSCoder) {
         super.init(coder: aDecoder)
         keyboardType = .decimalPad
+        self.addTarget(self, action: #selector(textDidChange), for: .editingChanged)
     }
     
     override public init(frame: CGRect) {
         super.init(frame: frame)
         keyboardType = .decimalPad
+        self.addTarget(self, action: #selector(textDidChange), for: .editingChanged)
     }
     
     // Prevent the user from moving the cursor

        }
    }
    
    fileprivate lazy var currencyFormatter: NumberFormatter = {
        let numberFormatter = NumberFormatter()
        numberFormatter.numberStyle = .currency

        }
    }
    
    private func parseCurrencyString(_ currencyString: String) -> Decimal? {
        
        if let decimal = Decimal(string: currencyString) {
            return decimal
        } else if let number = currencyFormatter.number(from: currencyString) {
            return number.decimalValue
        }
        
        return nil
    }
    
}
