fix a bug: after syncing password, the table view is frozen

This commit is contained in:
Bob Sun 2017-02-04 15:15:57 +08:00
parent 670619d22b
commit 7e34c6f81e
No known key found for this signature in database
GPG key ID: 1F86BA2052FED3B4

View file

@ -41,12 +41,11 @@ class PasswordsViewController: UIViewController, UITableViewDataSource, UITableV
}
})
DispatchQueue.main.async {
self.passwordEntities = PasswordStore.shared.fetchPasswordEntityCoreData()
self.reloadTableView(data: self.passwordEntities!)
SVProgressHUD.showSuccess(withStatus: "Done")
SVProgressHUD.dismiss(withDelay: 1)
}
print("pull success")
self.passwordEntities = PasswordStore.shared.fetchPasswordEntityCoreData()
self.reloadTableView(data: self.passwordEntities!)
} catch {
DispatchQueue.main.async {
SVProgressHUD.showError(withStatus: error.localizedDescription)