From 347a6d775087b724de30f999fdba0693af77502d Mon Sep 17 00:00:00 2001 From: Bob Sun Date: Wed, 5 Apr 2017 20:06:40 -0700 Subject: [PATCH] Fix end sync control refreshing issue Use syncAfter to work around. --- pass/Controllers/PasswordsViewController.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pass/Controllers/PasswordsViewController.swift b/pass/Controllers/PasswordsViewController.swift index edc5127..0b181df 100644 --- a/pass/Controllers/PasswordsViewController.swift +++ b/pass/Controllers/PasswordsViewController.swift @@ -158,8 +158,11 @@ class PasswordsViewController: UIViewController, UITableViewDataSource, UITableV } } catch { DispatchQueue.main.async { + SVProgressHUD.dismiss() self.syncControl.endRefreshing() - Utils.alert(title: "Error", message: error.localizedDescription, controller: self, completion: nil) + DispatchQueue.main.asyncAfter(deadline: .now() + .milliseconds(800)) { + Utils.alert(title: "Error", message: error.localizedDescription, controller: self, completion: nil) + } } } }