zoukankan      html  css  js  c++  java
  • swift textfield 和 textview 实时获取 输入内容

    textfield :
    
        func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool {
    
                let fullStr = (textField.text! as NSString).replacingCharacters(in: range, with: string)
                delegate?.changeTextFieldText(tfTag: textField.tag, text: fullStr)
    
            return true
        }
    

      

    textview : 一样

        func textView(_ textView: UITextView, shouldChangeTextIn range: NSRange, replacementText text: String) -> Bool {
    
            let fullStr = (textField.text! as NSString).replacingCharacters(in: range, with: string)
            return true
        }
    

      

  • 相关阅读:
    对我影响最大的三位导师
    global与nonlocal
    random模块
    time模块
    datetime模块
    sys模块
    os模块
    collection模块
    hashlib模块
    pickle模块
  • 原文地址:https://www.cnblogs.com/qingzZ/p/9628101.html
Copyright © 2011-2022 走看看