From 4376ba7255dadba9be1442383960e4a2f0364cc8 Mon Sep 17 00:00:00 2001 From: Marco Betschart Date: Mon, 2 Mar 2020 08:21:47 +0100 Subject: [PATCH] Made sure we are doing UI updates in ProgressCollectionViewController in main queue --- .../ProgressCollectionViewController.swift | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ProgressKit/ProgressCollectionViewController/ProgressCollectionViewController.swift b/ProgressKit/ProgressCollectionViewController/ProgressCollectionViewController.swift index 34ba7c3..0219394 100644 --- a/ProgressKit/ProgressCollectionViewController/ProgressCollectionViewController.swift +++ b/ProgressKit/ProgressCollectionViewController/ProgressCollectionViewController.swift @@ -177,14 +177,18 @@ open class ProgressCollectionViewController: UICollectionViewController, UIColle } guard let allReports = allReports else { - strongSelf.collectionView.reloadData() + DispatchQueue.main.async { + strongSelf.collectionView.reloadData() + } completionHandler?(nil) return } strongSelf.allReports = allReports - strongSelf.collectionView.reloadData() - strongSelf.collectionView.backgroundView?.isHidden = false == self?.allReports.first?.isEmpty + DispatchQueue.main.async { + strongSelf.collectionView.reloadData() + strongSelf.collectionView.backgroundView?.isHidden = false == self?.allReports.first?.isEmpty + } completionHandler?(nil) } })