Fix a retain cycle on MessageText.

This was generating warnings about an excessive number of gesture recognisers.
This commit is contained in:
Doug 2024-02-16 19:15:14 +00:00 committed by Stefan Ceriu
parent 939c4e7b33
commit 382b9a69c3

View File

@ -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 {