Updated modal copy. Copy update removed the need for separate versions of the modal.
This commit is contained in:
parent
b635fd4d45
commit
93ab639509
|
@ -11,29 +11,16 @@ 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)
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue