 
         if placeholder != nil {
             placeholderLabel?.isHidden = true
-            if self.text.characters.count ==  0 {
+            if self.text.count ==  0 {
                 self.placeholderLabel?.isHidden = false
             }
         }
         if limitLength != nil {
-            var wordCount = self.text.characters.count
+            var wordCount = self.text.count
             if wordCount > (limitLength?.intValue)! {
                 wordCount = (limitLength?.intValue)!
             }
             let limit = limitLength!.stringValue
             wordCountLabel?.text = "\(wordCount)/\(limit)"
         }
+        if autoHeight == true && self.oldFrame != nil {
+            let size = getStringPlaceSize(self.text, textFont: self.font!)
+            UIView.animate(withDuration: 0.15) {
+                self.frame = CGRect.init(x: (self.oldFrame?.origin.x)!, y: (self.oldFrame?.origin.y)!, width: (self.oldFrame?.size.width)!, height: size.height + 25 <= (self.oldFrame?.size.height)! ? (self.oldFrame?.size.height)! : size.height + 25)
+            }
+        }
         
     }
 
     @objc fileprivate func limitLengthEvent() {
         if limitLength != nil {
-            if self.text.characters.count > (limitLength?.intValue)! && limitLength != nil {
+            if self.text.count > (limitLength?.intValue)! && limitLength != nil {
                 self.text = (self.text as NSString).substring(to: (limitLength?.intValue)!)
                 print("Maximum number of words");
             }

            /*
             *  避免外部使用了约束 这里再次更新frame
             */
            wordCountLabel!.frame = CGRect(x: frame.width - 65, y: frame.height - 20, width: 60, height: 20)
        }
        if placeholder != nil && placeholderLabel != nil {
            let rect: CGRect = placeholder!.boundingRect(with: CGSize(width: frame.width - 7, height: CGFloat.greatestFiniteMagnitude), options: .usesLineFragmentOrigin, attributes: [NSFontAttributeName: UIFont.systemFont(ofSize: 13.0)], context: nil)
            placeholderLabel!.frame = CGRect(x: 7, y: 7, width: rect.size.width, height: rect.size.height)
        }
    }

}

        let size = string.boundingRect(with: CGSize(width: self.contentSize.width-10, height: CGFloat.greatestFiniteMagnitude), options: options, attributes: attribute, context: nil).size
        return size
    }
    //MARK: Swift分类竟然不支持
//    deinit {
//        NotificationCenter.default.removeObserver(self, name: .UITextViewTextDidChange, object: self)
//
