Skip to content
This repository has been archived by the owner on Jun 17, 2021. It is now read-only.

Commit

Permalink
fixed loosing data detector info
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyapuchka committed Jan 12, 2017
1 parent 1dc82c4 commit 1365fec
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Sources/ReadMoreTextView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -349,11 +349,11 @@ public class ReadMoreTextView: UITextView {
layoutManager.invalidateLayoutForCharacterRange(layoutManager.characterRangeThatFits(textContainer: textContainer), actualCharacterRange: nil)
textContainer.size = CGSize(width: bounds.size.width, height: CGFloat.max)
#endif

let range = rangeToReplaceWithReadMoreText()
guard range.location != NSNotFound else { return }


if let text = attributedReadMoreText {
let range = rangeToReplaceWithReadMoreText()
guard range.location != NSNotFound else { return }

#if swift(>=3.0)
textStorage.replaceCharacters(in: range, with: text)
#else
Expand All @@ -379,10 +379,10 @@ public class ReadMoreTextView: UITextView {

shouldTrim = false
textContainer.maximumNumberOfLines = 0

let range = NSRange(location: 0, length: text.length)


if let originalAttributedText = _originalAttributedText?.mutableCopy() as? NSMutableAttributedString {
attributedText = _originalAttributedText
let range = NSRange(location: 0, length: text.length)
#if swift(>=3.0)
if let attributedReadLessText = attributedReadLessText {
originalAttributedText.append(attributedReadLessText)
Expand Down

0 comments on commit 1365fec

Please sign in to comment.