From 0a11d2de474838e4923f4f947227043c9320da11 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Tue, 3 Nov 2020 15:49:30 -0500 Subject: [PATCH] Fix playing gifs from a background thread --- Tusker/Views/Attachments/AttachmentView.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Tusker/Views/Attachments/AttachmentView.swift b/Tusker/Views/Attachments/AttachmentView.swift index 7d6b46a9..61fa0440 100644 --- a/Tusker/Views/Attachments/AttachmentView.swift +++ b/Tusker/Views/Attachments/AttachmentView.swift @@ -165,7 +165,9 @@ class AttachmentView: UIImageView, GIFAnimatable { if self.attachment.url.pathExtension == "gif" { self.source = .gifData(attachmentURL, data) if self.autoplayGifs { - self.animate(withGIFData: data) + DispatchQueue.main.async { + self.animate(withGIFData: data) + } } else { self.displayImage() }