 open class LimitedTextField: UITextField {
     
     //MARK: - Property defines
+    fileprivate var selectionRange: NSRange = NSMakeRange(0, 0)
     
     fileprivate var historyText: String?
     

                    textField?.text = ""
                }
            }
            if flag {
                // Send limits msg
                sendIllegalMsgToObject();
            }
        }
    }
}

extension LimitedTextField {
//    inputDelegate
    fileprivate func sendIllegalMsgToObject() {
        guard let delegate = self.limitedDelegate
            , let realDelegate = delegate.realDelegate else {

        let maxLength = self.limitedNumber
        
        var position: UITextPosition?
        if let markedTextRange = textField?.markedTextRange {
            position = textField?.position(from: markedTextRange.start, offset: 0)
        }
        
        var isMatch = true
        switch self.limitedType {
        case .normal: break
        case .price:
            isMatch = MatchManager.matchLimitedTextTypePrice(component: textField!, value: currentText!)
        case .custom:
            isMatch = MatchManager.matchLimitedTextTypeCustom(regExs: self.limitedRegExs, component: textField!, value: currentText!)
        }
        
        if isMatch {
            self.historyText = textField?.text
