KennethTsang / GrowingTextView

An UITextView in Swift. Support auto growing, placeholder and length limit.
MIT License
1.07k stars 133 forks source link

not work GrowingTextViewDelegate #43

Open dan085 opened 6 years ago

dan085 commented 6 years ago

I change this code and reemplace this

` @objc func textDidChange(notification: Notification) { if let sender = notification.object as? GrowingTextView, sender == self { if maxLength > 0 && text.count > maxLength { let endIndex = text.index(text.startIndex, offsetBy: maxLength) text = String(text[..<endIndex]) undoManager?.removeAllActions() }

     -->     setNeedsLayout() /// with this line work
   --->   //  setNeedsDisplay() // remove this line
    }
}`