From aa0a31c25ee47b06bcd2eb80cb47deae03ff3902 Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Thu, 31 May 2018 11:45:49 -0400 Subject: [PATCH] Reduce viewWillAppear by ~5% by optimizing loadForTextDisplay // FREEBIE --- .../ConversationView/Cells/OWSMessageBubbleView.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageBubbleView.m b/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageBubbleView.m index 471a883a7..2a33bac77 100644 --- a/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageBubbleView.m +++ b/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageBubbleView.m @@ -525,7 +525,6 @@ NS_ASSUME_NONNULL_BEGIN shouldIgnoreEvents:(BOOL)shouldIgnoreEvents { textView.hidden = NO; - textView.text = text; textView.textColor = textColor; // Honor dynamic type in the message bodies. @@ -535,6 +534,9 @@ NS_ASSUME_NONNULL_BEGIN NSUnderlineStyleAttributeName : @(NSUnderlineStyleSingle | NSUnderlinePatternSolid) }; textView.shouldIgnoreEvents = shouldIgnoreEvents; + + // For perf, set text last. Otherwise changing font/color is more expensive. + textView.text = text; } - (BOOL)hasTapForMore