Rename MarkArticlesReadAlertController to UndoAvailableAlertController to better reflect its new purpose
This commit is contained in:
parent
f57d3f7df8
commit
8656753423
|
@ -407,7 +407,7 @@
|
|||
FF3ABF13232599810074C542 /* ArticleSorterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF3ABF09232599450074C542 /* ArticleSorterTests.swift */; };
|
||||
FF3ABF1523259DDB0074C542 /* ArticleSorter.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF3ABF1423259DDB0074C542 /* ArticleSorter.swift */; };
|
||||
FF3ABF162325AF5D0074C542 /* ArticleSorter.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF3ABF1423259DDB0074C542 /* ArticleSorter.swift */; };
|
||||
FFD43E412340F488009E5CA3 /* MarkArticlesReadAlertController.swift in Sources */ = {isa = PBXBuildFile; fileRef = FFD43E372340F320009E5CA3 /* MarkArticlesReadAlertController.swift */; };
|
||||
FFD43E412340F488009E5CA3 /* UndoAvailableAlertController.swift in Sources */ = {isa = PBXBuildFile; fileRef = FFD43E372340F320009E5CA3 /* UndoAvailableAlertController.swift */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
|
@ -1041,7 +1041,7 @@
|
|||
DF999FF622B5AEFA0064B687 /* SafariView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SafariView.swift; sourceTree = "<group>"; };
|
||||
FF3ABF09232599450074C542 /* ArticleSorterTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArticleSorterTests.swift; sourceTree = "<group>"; };
|
||||
FF3ABF1423259DDB0074C542 /* ArticleSorter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArticleSorter.swift; sourceTree = "<group>"; };
|
||||
FFD43E372340F320009E5CA3 /* MarkArticlesReadAlertController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MarkArticlesReadAlertController.swift; sourceTree = "<group>"; };
|
||||
FFD43E372340F320009E5CA3 /* UndoAvailableAlertController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UndoAvailableAlertController.swift; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
|
@ -1289,7 +1289,7 @@
|
|||
51C4525D226508F600C03939 /* MasterFeed */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
FFD43E372340F320009E5CA3 /* MarkArticlesReadAlertController.swift */,
|
||||
FFD43E372340F320009E5CA3 /* UndoAvailableAlertController.swift */,
|
||||
51C45264226508F600C03939 /* MasterFeedViewController.swift */,
|
||||
51CC9B3D231720B2000E842F /* MasterFeedDataSource.swift */,
|
||||
51C45260226508F600C03939 /* Cell */,
|
||||
|
@ -2215,11 +2215,17 @@
|
|||
TargetAttributes = {
|
||||
513C5CE5232571C2003D4054 = {
|
||||
CreatedOnToolsVersion = 11.0;
|
||||
DevelopmentTeam = SHJK2V3AJG;
|
||||
ProvisioningStyle = Automatic;
|
||||
};
|
||||
6581C73220CED60000F4AD34 = {
|
||||
DevelopmentTeam = SHJK2V3AJG;
|
||||
ProvisioningStyle = Automatic;
|
||||
};
|
||||
840D617B2029031C009BC708 = {
|
||||
CreatedOnToolsVersion = 9.3;
|
||||
DevelopmentTeam = SHJK2V3AJG;
|
||||
ProvisioningStyle = Automatic;
|
||||
SystemCapabilities = {
|
||||
com.apple.BackgroundModes = {
|
||||
enabled = 1;
|
||||
|
@ -2228,6 +2234,8 @@
|
|||
};
|
||||
849C645F1ED37A5D003D8FC0 = {
|
||||
CreatedOnToolsVersion = 8.2.1;
|
||||
DevelopmentTeam = SHJK2V3AJG;
|
||||
ProvisioningStyle = Automatic;
|
||||
SystemCapabilities = {
|
||||
com.apple.HardenedRuntime = {
|
||||
enabled = 1;
|
||||
|
@ -2236,7 +2244,7 @@
|
|||
};
|
||||
849C64701ED37A5D003D8FC0 = {
|
||||
CreatedOnToolsVersion = 8.2.1;
|
||||
DevelopmentTeam = 9C84TZ7Q6Z;
|
||||
DevelopmentTeam = SHJK2V3AJG;
|
||||
ProvisioningStyle = Automatic;
|
||||
TestTargetID = 849C645F1ED37A5D003D8FC0;
|
||||
};
|
||||
|
@ -2819,7 +2827,7 @@
|
|||
51C4529F22650A1900C03939 /* AuthorAvatarDownloader.swift in Sources */,
|
||||
519E743D22C663F900A78E47 /* SceneDelegate.swift in Sources */,
|
||||
51CC9B3E231720B2000E842F /* MasterFeedDataSource.swift in Sources */,
|
||||
FFD43E412340F488009E5CA3 /* MarkArticlesReadAlertController.swift in Sources */,
|
||||
FFD43E412340F488009E5CA3 /* UndoAvailableAlertController.swift in Sources */,
|
||||
51C452A322650A1E00C03939 /* HTMLMetadataDownloader.swift in Sources */,
|
||||
51C4528D2265095F00C03939 /* AddFolderViewController.swift in Sources */,
|
||||
51C452782265091600C03939 /* MasterTimelineCellData.swift in Sources */,
|
||||
|
|
|
@ -22,7 +22,7 @@ struct AppDefaults {
|
|||
static let timelineGroupByFeed = "timelineGroupByFeed"
|
||||
static let timelineNumberOfLines = "timelineNumberOfLines"
|
||||
static let timelineSortDirection = "timelineSortDirection"
|
||||
static let displayMarkAllAsReadUndoTip = "displayMarkAllAsReadUndoTip"
|
||||
static let displayUndoAvailableTip = "displayUndoAvailableTip"
|
||||
static let refreshInterval = "refreshInterval"
|
||||
static let lastRefresh = "lastRefresh"
|
||||
}
|
||||
|
@ -72,12 +72,12 @@ struct AppDefaults {
|
|||
}
|
||||
}
|
||||
|
||||
static var displayMarkAllAsReadUndoTip: Bool {
|
||||
static var displayUndoAvailableTip: Bool {
|
||||
get {
|
||||
return bool(for: Key.displayMarkAllAsReadUndoTip)
|
||||
return bool(for: Key.displayUndoAvailableTip)
|
||||
}
|
||||
set {
|
||||
setBool(for: Key.displayMarkAllAsReadUndoTip, newValue)
|
||||
setBool(for: Key.displayUndoAvailableTip, newValue)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -105,7 +105,7 @@ struct AppDefaults {
|
|||
Key.timelineGroupByFeed: false,
|
||||
Key.timelineNumberOfLines: 3,
|
||||
Key.timelineSortDirection: ComparisonResult.orderedDescending.rawValue,
|
||||
Key.displayMarkAllAsReadUndoTip: true]
|
||||
Key.displayUndoAvailableTip: true]
|
||||
AppDefaults.shared.register(defaults: defaults)
|
||||
}
|
||||
|
||||
|
|
|
@ -344,9 +344,9 @@ class MasterFeedViewController: UITableViewController, UndoableCommandRunner {
|
|||
}
|
||||
|
||||
@IBAction func markAllAsRead(_ sender: Any) {
|
||||
if coordinator.displayMarkAllAsReadUndoTip {
|
||||
let alertController = MarkArticlesReadAlertController.markAllAsReadAlert { [weak self] _ in
|
||||
self?.coordinator.displayMarkAllAsReadUndoTip = false
|
||||
if coordinator.displayUndoAvailableTip {
|
||||
let alertController = UndoAvailableAlertController.alert { [weak self] _ in
|
||||
self?.coordinator.displayUndoAvailableTip = false
|
||||
self?.coordinator.markAllAsRead()
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
//
|
||||
// MarkArticlesReadAlertControllerr.swift
|
||||
// UndoAvailableAlertController.swift
|
||||
// NetNewsWire
|
||||
//
|
||||
// Created by Phil Viso on 9/29/19.
|
||||
|
@ -9,10 +9,10 @@
|
|||
import Foundation
|
||||
import UIKit
|
||||
|
||||
struct MarkArticlesReadAlertController {
|
||||
struct UndoAvailableAlertController {
|
||||
|
||||
static func markAllAsReadAlert(handler: @escaping (UIAlertAction) -> Void) -> UIAlertController {
|
||||
let title = NSLocalizedString("Mark All Read", comment: "Mark All Read")
|
||||
static func alert(handler: @escaping (UIAlertAction) -> Void) -> UIAlertController {
|
||||
let title = NSLocalizedString("Undo Available", comment: "Undo Available")
|
||||
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")
|
|
@ -89,9 +89,9 @@ class MasterTimelineViewController: UITableViewController, UndoableCommandRunner
|
|||
// MARK: Actions
|
||||
|
||||
@IBAction func markAllAsRead(_ sender: Any) {
|
||||
if coordinator.displayMarkAllAsReadUndoTip {
|
||||
let alertController = MarkArticlesReadAlertController.markAllAsReadAlert { [weak self] _ in
|
||||
self?.coordinator.displayMarkAllAsReadUndoTip = false
|
||||
if coordinator.displayUndoAvailableTip {
|
||||
let alertController = UndoAvailableAlertController.alert { [weak self] _ in
|
||||
self?.coordinator.displayUndoAvailableTip = false
|
||||
self?.coordinator.markAllAsReadInTimeline()
|
||||
}
|
||||
|
||||
|
|
|
@ -83,9 +83,9 @@ class SceneCoordinator: NSObject, UndoableCommandRunner, UnreadCountProvider {
|
|||
}
|
||||
}
|
||||
|
||||
var displayMarkAllAsReadUndoTip: Bool {
|
||||
get { AppDefaults.displayMarkAllAsReadUndoTip }
|
||||
set { AppDefaults.displayMarkAllAsReadUndoTip = newValue }
|
||||
var displayUndoAvailableTip: Bool {
|
||||
get { AppDefaults.displayUndoAvailableTip }
|
||||
set { AppDefaults.displayUndoAvailableTip = newValue }
|
||||
}
|
||||
|
||||
private let treeControllerDelegate = FeedTreeControllerDelegate()
|
||||
|
|
Loading…
Reference in New Issue