fix added to end of text
There are times when a character string is added to the end of attributedText. I was thinking that it would be useful as a means to remedy the phenomenon, and I made a PR.
_needsUpdateTrim was true with the following function _originalAttributedText is substituted and modified,
but
public override func layoutSubviews () {
super.layoutSubviews ()
if _needsUpdateTrim {
/ / reset text to force update trim
attributedText = _originalAttributedText
_needsUpdateTrim = false
}
needsTrim ()? showLessText (): showMoreText ()
}
i think Please confirm that this is more stronger PR created
best regards
how to scroll after read more action ?
textview scroll is not showing ?
oh Dog! LGTM?
Its not Working on RTL
Anyone have an idea why the func hitTest gets called twice?
Hi! @ilyapuchka Shouldn’t we closed once?

hello, i have issue in text with emoji so look this issue
hello, i have issue in text with emoji so look this issue
In ReadMoreTextView.swift > showMoreText() method, replace text.unicodeScalars.count with text.length. The final method will be:
private func showMoreText() { if let readLessText = readLessText, text.hasSuffix(readLessText) { return }
shouldTrim = false
textContainer.maximumNumberOfLines = 0
if let originalAttributedText = _originalAttributedText?.mutableCopy() as? NSMutableAttributedString {
attributedText = _originalAttributedText
let range = NSRange(location: 0, length: text.length)
if let attributedReadLessText = attributedReadLessText {
originalAttributedText.append(attributedReadLessText)
}
textStorage.replaceCharacters(in: range, with: originalAttributedText)
}
invalidateIntrinsicContentSize()
invokeOnSizeChangeIfNeeded()
}