From 04458adee5ddb06b234dba5d7c68d90daa803883 Mon Sep 17 00:00:00 2001 From: Rizwan Mohamed Ibrahim Date: Thu, 14 May 2020 18:13:41 +0530 Subject: [PATCH] adds "Mark All Read" shortcut for feeds list --- iOS/MasterFeed/MasterFeedViewController.swift | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/iOS/MasterFeed/MasterFeedViewController.swift b/iOS/MasterFeed/MasterFeedViewController.swift index accf4b67e..651afc6c2 100644 --- a/iOS/MasterFeed/MasterFeedViewController.swift +++ b/iOS/MasterFeed/MasterFeedViewController.swift @@ -458,7 +458,18 @@ class MasterFeedViewController: UITableViewController, UndoableCommandRunner { self.reloadAllVisibleCells() } } - + + @objc func markAllAsRead(_ sender: Any) { + guard let indexPath = tableView.indexPathForSelectedRow, let contentView = tableView.cellForRow(at: indexPath)?.contentView else { + return + } + + let title = NSLocalizedString("Mark All as Read", comment: "Mark All as Read") + MarkAsReadAlertController.confirm(self, coordinator: coordinator, confirmTitle: title, sourceType: contentView) { [weak self] in + self?.coordinator.markAllAsReadInTimeline() + } + } + // MARK: API func restoreSelectionIfNecessary(adjustScroll: Bool) {