Open dan085 opened 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 } }`
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() }