From 8656753423ae19a7785b69ee22949dd92c561f9d Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Thu, 10 Oct 2019 15:13:20 -0500 Subject: [PATCH] Rename MarkArticlesReadAlertController to UndoAvailableAlertController to better reflect its new purpose --- NetNewsWire.xcodeproj/project.pbxproj | 18 +++++++++++++----- iOS/AppDefaults.swift | 10 +++++----- iOS/MasterFeed/MasterFeedViewController.swift | 6 +++--- ...wift => UndoAvailableAlertController.swift} | 8 ++++---- .../MasterTimelineViewController.swift | 6 +++--- iOS/SceneCoordinator.swift | 6 +++--- 6 files changed, 31 insertions(+), 23 deletions(-) rename iOS/MasterFeed/{MarkArticlesReadAlertController.swift => UndoAvailableAlertController.swift} (76%) diff --git a/NetNewsWire.xcodeproj/project.pbxproj b/NetNewsWire.xcodeproj/project.pbxproj index 69f6b8645..76f890f70 100644 --- a/NetNewsWire.xcodeproj/project.pbxproj +++ b/NetNewsWire.xcodeproj/project.pbxproj @@ -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 = ""; }; FF3ABF09232599450074C542 /* ArticleSorterTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArticleSorterTests.swift; sourceTree = ""; }; FF3ABF1423259DDB0074C542 /* ArticleSorter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArticleSorter.swift; sourceTree = ""; }; - FFD43E372340F320009E5CA3 /* MarkArticlesReadAlertController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MarkArticlesReadAlertController.swift; sourceTree = ""; }; + FFD43E372340F320009E5CA3 /* UndoAvailableAlertController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UndoAvailableAlertController.swift; sourceTree = ""; }; /* 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 */, diff --git a/iOS/AppDefaults.swift b/iOS/AppDefaults.swift index 53589a0dc..d5ddda7a1 100644 --- a/iOS/AppDefaults.swift +++ b/iOS/AppDefaults.swift @@ -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) } diff --git a/iOS/MasterFeed/MasterFeedViewController.swift b/iOS/MasterFeed/MasterFeedViewController.swift index c76cad5b6..7022f7a7f 100644 --- a/iOS/MasterFeed/MasterFeedViewController.swift +++ b/iOS/MasterFeed/MasterFeedViewController.swift @@ -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() } diff --git a/iOS/MasterFeed/MarkArticlesReadAlertController.swift b/iOS/MasterFeed/UndoAvailableAlertController.swift similarity index 76% rename from iOS/MasterFeed/MarkArticlesReadAlertController.swift rename to iOS/MasterFeed/UndoAvailableAlertController.swift index d105be343..0d9ea4767 100644 --- a/iOS/MasterFeed/MarkArticlesReadAlertController.swift +++ b/iOS/MasterFeed/UndoAvailableAlertController.swift @@ -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") diff --git a/iOS/MasterTimeline/MasterTimelineViewController.swift b/iOS/MasterTimeline/MasterTimelineViewController.swift index e400514af..8c74296ab 100644 --- a/iOS/MasterTimeline/MasterTimelineViewController.swift +++ b/iOS/MasterTimeline/MasterTimelineViewController.swift @@ -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() } diff --git a/iOS/SceneCoordinator.swift b/iOS/SceneCoordinator.swift index a74707394..a647e5b35 100644 --- a/iOS/SceneCoordinator.swift +++ b/iOS/SceneCoordinator.swift @@ -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()