Skip to content

Commit

Permalink
Fix a retain cycle on MessageText.
Browse files Browse the repository at this point in the history
This was generating warnings about an excessive number of gesture recognisers.
  • Loading branch information
pixlwave authored and stefanceriu committed Feb 16, 2024
1 parent 939c4e7 commit 382b9a6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ElementX/Sources/Other/Pills/MessageText.swift
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ struct MessageText: UIViewRepresentable {
// Need to use TextKit 1 for mentions
let textView = MessageTextView(usingTextLayoutManager: false)
textView.roomContext = viewModel
textView.updateClosure = {
textView.updateClosure = { [weak textView] in
guard let textView else { return }
do {
attributedString = try AttributedString(textView.attributedText, including: \.elementX)
} catch {
Expand Down

0 comments on commit 382b9a6

Please sign in to comment.