From 374c6c8c10b1f3951f6bac95165184b1c11b5bbb Mon Sep 17 00:00:00 2001 From: Bob Sun Date: Tue, 16 Jan 2018 20:04:16 -0800 Subject: [PATCH] Fix double tap scroll to top issue --- pass/Controllers/PasswordsViewController.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pass/Controllers/PasswordsViewController.swift b/pass/Controllers/PasswordsViewController.swift index fe51731..2ac3275 100644 --- a/pass/Controllers/PasswordsViewController.swift +++ b/pass/Controllers/PasswordsViewController.swift @@ -554,9 +554,9 @@ class PasswordsViewController: UIViewController, UITableViewDataSource, UITableV self.tapTabBarTime = currentTime if duration < 0.35 { let topIndexPath = IndexPath(row: 0, section: 0) - if let _ = tableView.cellForRow(at: topIndexPath) { - tableView.scrollToRow(at: topIndexPath, at: .bottom, animated: true) - } + if tableView.numberOfSections > 0 { + tableView.scrollToRow(at: topIndexPath, at: .bottom, animated: true) + } self.tapTabBarTime = 0 return }