Skip to content

Commit

Permalink
Support TextKit 2 in the Reader (#1072)
Browse files Browse the repository at this point in the history
* feat(reader): add support for TextKit2

* feat(textkit 2): improve naming

* feat(textkit 2): fix initialization code in ArticleComponentTextView
  • Loading branch information
Gio2018 committed Sep 5, 2024
1 parent 71a3d56 commit 091f071
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,8 @@ class ArticleComponentTextView: UITextView {
attributedText.isFullyHighlighted(fullRange)
}

override init(frame: CGRect, textContainer: NSTextContainer?) {
super.init(frame: frame, textContainer: textContainer)

convenience override init(frame: CGRect, textContainer: NSTextContainer?) {
self.init(usingTextLayoutManager: true)
backgroundColor = .clear
textContainerInset = .zero
self.textContainer.lineFragmentPadding = .zero
Expand All @@ -80,7 +79,6 @@ class ArticleComponentTextView: UITextView {
delegate = self

linkTextAttributes = [.foregroundColor: UIColor(.ui.black1)]

interactions
.filter { $0 is UIContextMenuInteraction }
.forEach { removeInteraction($0) }
Expand Down

0 comments on commit 091f071

Please sign in to comment.