weak self
This commit is contained in:
parent
ac007fec6d
commit
c0edb7d336
1 changed files with 9 additions and 7 deletions
|
|
@ -86,12 +86,12 @@ class PasswordDetailTableViewController: UITableViewController, UIGestureRecogni
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DispatchQueue.main.async {
|
DispatchQueue.main.async { [weak self] in
|
||||||
self.tableView.reloadData()
|
self?.tableView.reloadData()
|
||||||
indicator.stopAnimating()
|
indicator.stopAnimating()
|
||||||
indicatorLable.isHidden = true
|
indicatorLable.isHidden = true
|
||||||
if self.password.url != "" {
|
if self?.password.url != "" {
|
||||||
self.updatePasswordImage(url: self.password.url)
|
self?.updatePasswordImage(url: self?.password.url ?? "")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -99,12 +99,14 @@ class PasswordDetailTableViewController: UITableViewController, UIGestureRecogni
|
||||||
|
|
||||||
func updatePasswordImage(url: String) {
|
func updatePasswordImage(url: String) {
|
||||||
do {
|
do {
|
||||||
try FavIcon.downloadPreferred(url) { result in
|
print("downloading: \(url)")
|
||||||
|
try FavIcon.downloadPreferred(url) { [weak self] result in
|
||||||
switch result {
|
switch result {
|
||||||
case .success(let image):
|
case .success(let image):
|
||||||
let indexPath = IndexPath(row: 0, section: 0)
|
let indexPath = IndexPath(row: 0, section: 0)
|
||||||
self.passwordImage = image
|
self?.passwordImage = image
|
||||||
self.tableView.reloadRows(at: [indexPath], with: UITableViewRowAnimation.automatic)
|
self?.tableView.reloadRows(at: [indexPath], with: UITableViewRowAnimation.automatic)
|
||||||
|
print("success")
|
||||||
case .failure(let error):
|
case .failure(let error):
|
||||||
print(error)
|
print(error)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue