unowned self in closure

This commit is contained in:
Bob Sun 2017-02-04 11:35:28 +08:00
parent 8755575779
commit 57a6a3f881
No known key found for this signature in database
GPG key ID: 1F86BA2052FED3B4

View file

@ -29,7 +29,7 @@ class PasswordsViewController: UIViewController, UITableViewDataSource, UITableV
@IBAction func refreshPasswords(_ sender: UIBarButtonItem) {
SVProgressHUD.setDefaultMaskType(.black)
SVProgressHUD.show(withStatus: "Pull Remote Repository")
DispatchQueue.global(qos: .userInitiated).async {
DispatchQueue.global(qos: .userInitiated).async { [unowned self] in
if PasswordStore.shared.pullRepository(transferProgressBlock: {(git_transfer_progress, stop) in
DispatchQueue.main.async {
SVProgressHUD.showProgress(Float(git_transfer_progress.pointee.received_objects)/Float(git_transfer_progress.pointee.total_objects), status: "Pull Remote Repository")