From b2794510f5393572bf437facfa8e9ffd0622797f Mon Sep 17 00:00:00 2001 From: Salman Jamil Date: Wed, 14 Nov 2018 12:20:06 +0500 Subject: [PATCH] Fixed Grapheme Clusters Issue --- Sources/ReadMoreTextView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/ReadMoreTextView.swift b/Sources/ReadMoreTextView.swift index 83745e4..071f1b4 100644 --- a/Sources/ReadMoreTextView.swift +++ b/Sources/ReadMoreTextView.swift @@ -274,7 +274,7 @@ public class ReadMoreTextView: UITextView { if let originalAttributedText = _originalAttributedText?.mutableCopy() as? NSMutableAttributedString { attributedText = _originalAttributedText - let range = NSRange(location: 0, length: text.length) + let range = NSRange(location: 0, length: text.unicodeScalars.count) if let attributedReadLessText = attributedReadLessText { originalAttributedText.append(attributedReadLessText) }