From aa7c60ee3a4e484ec8dbbe55e04c16bcf8a9c625 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Fri, 6 Sep 2019 11:11:28 -0500 Subject: [PATCH] Prevent row selection on iPhone as keeping selected rows highlighted is an iPad only feature --- iOS/MasterFeed/MasterFeedViewController.swift | 3 +++ iOS/MasterTimeline/MasterTimelineViewController.swift | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/iOS/MasterFeed/MasterFeedViewController.swift b/iOS/MasterFeed/MasterFeedViewController.swift index 04fb25d19..e42359002 100644 --- a/iOS/MasterFeed/MasterFeedViewController.swift +++ b/iOS/MasterFeed/MasterFeedViewController.swift @@ -432,6 +432,9 @@ class MasterFeedViewController: UITableViewController, UndoableCommandRunner { // MARK: API func updateFeedSelection() { + guard traitCollection.userInterfaceIdiom == .pad else { + return + } if let indexPath = coordinator.currentFeedIndexPath { if tableView.indexPathForSelectedRow != indexPath { tableView.selectRow(at: indexPath, animated: true, scrollPosition: .middle) diff --git a/iOS/MasterTimeline/MasterTimelineViewController.swift b/iOS/MasterTimeline/MasterTimelineViewController.swift index bfa04de25..d9b6b9353 100644 --- a/iOS/MasterTimeline/MasterTimelineViewController.swift +++ b/iOS/MasterTimeline/MasterTimelineViewController.swift @@ -156,8 +156,10 @@ class MasterTimelineViewController: UITableViewController, UndoableCommandRunner } func updateArticleSelection(animate: Bool) { - guard !coordinator.articles.isEmpty else { return } - + guard traitCollection.userInterfaceIdiom == .pad && !coordinator.articles.isEmpty else { + return + } + if let indexPath = coordinator.currentArticleIndexPath { if tableView.indexPathForSelectedRow != indexPath { tableView.selectRow(at: indexPath, animated: animate, scrollPosition: .middle)