From b1ef8a343fcdca2bf47a77cef279e85336eb9be0 Mon Sep 17 00:00:00 2001 From: Bob Sun Date: Mon, 10 Apr 2017 22:09:39 -0700 Subject: [PATCH] Fix some issues may cause crash --- .../PasswordDetailTableViewController.swift | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/pass/Controllers/PasswordDetailTableViewController.swift b/pass/Controllers/PasswordDetailTableViewController.swift index 84c5773..4564ab2 100644 --- a/pass/Controllers/PasswordDetailTableViewController.swift +++ b/pass/Controllers/PasswordDetailTableViewController.swift @@ -164,11 +164,7 @@ class PasswordDetailTableViewController: UITableViewController, UIGestureRecogni DispatchQueue.main.async { [weak self] in self?.indicator.stopAnimating() self?.setTableData() - UIView.performWithoutAnimation { - self?.tableView.reloadData() - // add layoutIfNeeded solves the "flickering problem" during refresh - self?.tableView.layoutIfNeeded() - } + self?.tableView.reloadData() self?.editUIBarButtonItem.isEnabled = true if let urlString = self?.password?.getURLString() { if self?.passwordEntity?.image == nil { @@ -432,11 +428,13 @@ class PasswordDetailTableViewController: UITableViewController, UIGestureRecogni case .name: let cell = tableView.dequeueReusableCell(withIdentifier: "passwordDetailTitleTableViewCell", for: indexPath) as! PasswordDetailTitleTableViewCell cell.passwordImageImageView.image = passwordImage ?? #imageLiteral(resourceName: "PasswordImagePlaceHolder") - var passwordName = passwordEntity!.name! - if passwordEntity!.synced == false { - passwordName = "\(passwordName) ↻" + if let passwordName = passwordEntity!.name { + if passwordEntity!.synced == false { + cell.nameLabel.text = "\(passwordName) ↻" + } else { + cell.nameLabel.text = passwordName + } } - cell.nameLabel.text = passwordName cell.categoryLabel.text = passwordCategoryText cell.selectionStyle = .none return cell