From 93ab639509fc01123b794b9f6f285635e9905f11 Mon Sep 17 00:00:00 2001 From: Phil Viso Date: Mon, 7 Oct 2019 21:13:00 -0500 Subject: [PATCH] Updated modal copy. Copy update removed the need for separate versions of the modal. --- .../MarkArticlesReadAlertController.swift | 25 +++++-------------- iOS/MasterFeed/MasterFeedViewController.swift | 2 +- .../MasterTimelineViewController.swift | 2 +- 3 files changed, 8 insertions(+), 21 deletions(-) diff --git a/iOS/MasterFeed/MarkArticlesReadAlertController.swift b/iOS/MasterFeed/MarkArticlesReadAlertController.swift index 4fa18f667..d105be343 100644 --- a/iOS/MasterFeed/MarkArticlesReadAlertController.swift +++ b/iOS/MasterFeed/MarkArticlesReadAlertController.swift @@ -10,30 +10,17 @@ import Foundation import UIKit struct MarkArticlesReadAlertController { - - static func allArticlesAlert(handler: @escaping (UIAlertAction) -> Void) -> UIAlertController { - let message = NSLocalizedString("Mark all articles in all accounts as read? You can undo this action with a three finger swipe to the left.", - comment: "Mark all articles") - return markAllReadAlert(message: message, handler: handler) - } - - static func timelineArticlesAlert(handler: @escaping (UIAlertAction) -> Void) -> UIAlertController { - let message = NSLocalizedString("Mark all articles in this timeline as read? You can undo this action with a three finger swipe to the left.", - comment: "Mark all articles") - return markAllReadAlert(message: message, handler: handler) - } - - // MARK: - - - private static func markAllReadAlert(message: String, - handler: @escaping (UIAlertAction) -> Void) -> UIAlertController { + + static func markAllAsReadAlert(handler: @escaping (UIAlertAction) -> Void) -> UIAlertController { let title = NSLocalizedString("Mark All Read", comment: "Mark All Read") + let message = NSLocalizedString("You can undo this and other actions with a three finger swipe to the left.", + comment: "Mark all articles") let cancelTitle = NSLocalizedString("Cancel", comment: "Cancel") - let markTitle = NSLocalizedString("Mark All Read", comment: "Mark All Read") + let confirmTitle = NSLocalizedString("Got It", comment: "Got It") let alertController = UIAlertController(title: title, message: message, preferredStyle: .alert) let cancelAction = UIAlertAction(title: cancelTitle, style: .cancel) - let markAction = UIAlertAction(title: markTitle, style: .default, handler: handler) + let markAction = UIAlertAction(title: confirmTitle, style: .default, handler: handler) alertController.addAction(cancelAction) alertController.addAction(markAction) diff --git a/iOS/MasterFeed/MasterFeedViewController.swift b/iOS/MasterFeed/MasterFeedViewController.swift index 6fbf9c830..7fb07f9ce 100644 --- a/iOS/MasterFeed/MasterFeedViewController.swift +++ b/iOS/MasterFeed/MasterFeedViewController.swift @@ -345,7 +345,7 @@ class MasterFeedViewController: UITableViewController, UndoableCommandRunner { @IBAction func markAllAsRead(_ sender: Any) { if coordinator.displayMarkAllAsReadUndoTip { - let alertController = MarkArticlesReadAlertController.allArticlesAlert { [weak self] _ in + let alertController = MarkArticlesReadAlertController.markAllAsReadAlert { [weak self] _ in self?.coordinator.displayMarkAllAsReadUndoTip = false self?.coordinator.markAllAsRead() } diff --git a/iOS/MasterTimeline/MasterTimelineViewController.swift b/iOS/MasterTimeline/MasterTimelineViewController.swift index 862e8da18..df8a58b1b 100644 --- a/iOS/MasterTimeline/MasterTimelineViewController.swift +++ b/iOS/MasterTimeline/MasterTimelineViewController.swift @@ -90,7 +90,7 @@ class MasterTimelineViewController: UITableViewController, UndoableCommandRunner @IBAction func markAllAsRead(_ sender: Any) { if coordinator.displayMarkAllAsReadUndoTip { - let alertController = MarkArticlesReadAlertController.timelineArticlesAlert { [weak self] _ in + let alertController = MarkArticlesReadAlertController.markAllAsReadAlert { [weak self] _ in self?.coordinator.displayMarkAllAsReadUndoTip = false self?.coordinator.markAllAsReadInTimeline() }