From dc6bf05ae4481e78aa953f9fd3c56a4a657b100f Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Sun, 25 Aug 2019 14:43:11 -0500 Subject: [PATCH] Rename ActivityFactory to ActivityManager because it will also handle activity deletes in the future --- NetNewsWire.xcodeproj/project.pbxproj | 8 ++++---- .../{ActivityFactory.swift => ActivityManager.swift} | 8 +++++--- iOS/AppCoordinator.swift | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) rename Shared/Activity/{ActivityFactory.swift => ActivityManager.swift} (89%) diff --git a/NetNewsWire.xcodeproj/project.pbxproj b/NetNewsWire.xcodeproj/project.pbxproj index 5d1f319dc..130375a2f 100644 --- a/NetNewsWire.xcodeproj/project.pbxproj +++ b/NetNewsWire.xcodeproj/project.pbxproj @@ -47,7 +47,7 @@ 5183CCED22711DCE0010922C /* Settings.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5183CCEC22711DCE0010922C /* Settings.storyboard */; }; 5183CCEF227125970010922C /* SettingsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5183CCEE227125970010922C /* SettingsViewController.swift */; }; 51934CCB230F599B006127BE /* ThemedNavigationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51934CC1230F5963006127BE /* ThemedNavigationController.swift */; }; - 51934CCE2310792F006127BE /* ActivityFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51934CCD2310792F006127BE /* ActivityFactory.swift */; }; + 51934CCE2310792F006127BE /* ActivityManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51934CCD2310792F006127BE /* ActivityManager.swift */; }; 51934CD023108953006127BE /* ActivityID.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51934CCF23108953006127BE /* ActivityID.swift */; }; 519B8D332143397200FA689C /* SharingServiceDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 519B8D322143397200FA689C /* SharingServiceDelegate.swift */; }; 519E743D22C663F900A78E47 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 519E743422C663F900A78E47 /* SceneDelegate.swift */; }; @@ -704,7 +704,7 @@ 5183CCEC22711DCE0010922C /* Settings.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Settings.storyboard; sourceTree = ""; }; 5183CCEE227125970010922C /* SettingsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsViewController.swift; sourceTree = ""; }; 51934CC1230F5963006127BE /* ThemedNavigationController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ThemedNavigationController.swift; sourceTree = ""; }; - 51934CCD2310792F006127BE /* ActivityFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActivityFactory.swift; sourceTree = ""; }; + 51934CCD2310792F006127BE /* ActivityManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActivityManager.swift; sourceTree = ""; }; 51934CCF23108953006127BE /* ActivityID.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActivityID.swift; sourceTree = ""; }; 5194B5ED22B6965300144881 /* SettingsSubscriptionsImportDocumentPickerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsSubscriptionsImportDocumentPickerView.swift; sourceTree = ""; }; 5194B5F122B69FCC00144881 /* SettingsSubscriptionsExportDocumentPickerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsSubscriptionsExportDocumentPickerView.swift; sourceTree = ""; }; @@ -1093,7 +1093,7 @@ 51934CCC231078DC006127BE /* Activity */ = { isa = PBXGroup; children = ( - 51934CCD2310792F006127BE /* ActivityFactory.swift */, + 51934CCD2310792F006127BE /* ActivityManager.swift */, 51934CCF23108953006127BE /* ActivityID.swift */, 51D87EE02311D34700E63F03 /* ActivityType.swift */, ); @@ -2452,7 +2452,7 @@ 51C452762265091600C03939 /* MasterTimelineViewController.swift in Sources */, 5183CCE9226F68D90010922C /* AccountRefreshTimer.swift in Sources */, 51C452882265093600C03939 /* AddFeedViewController.swift in Sources */, - 51934CCE2310792F006127BE /* ActivityFactory.swift in Sources */, + 51934CCE2310792F006127BE /* ActivityManager.swift in Sources */, DF999FF722B5AEFA0064B687 /* SafariView.swift in Sources */, 51C4529B22650A1000C03939 /* FaviconDownloader.swift in Sources */, 84DEE56622C32CA4005FC42C /* SmartFeedDelegate.swift in Sources */, diff --git a/Shared/Activity/ActivityFactory.swift b/Shared/Activity/ActivityManager.swift similarity index 89% rename from Shared/Activity/ActivityFactory.swift rename to Shared/Activity/ActivityManager.swift index 93ca5c892..582983d15 100644 --- a/Shared/Activity/ActivityFactory.swift +++ b/Shared/Activity/ActivityManager.swift @@ -1,5 +1,5 @@ // -// ActivityFactory.swift +// ActivityManager.swift // NetNewsWire-iOS // // Created by Maurice Parker on 8/23/19. @@ -11,9 +11,11 @@ import CoreSpotlight import CoreServices import Articles -class ActivityFactory { +class ActivityManager { - static func make(_ article: Article) -> NSUserActivity { + public static var shared = ActivityManager() + + func makeReadArticleActivity(_ article: Article) -> NSUserActivity { let activity = NSUserActivity(activityType: ActivityType.readArticle.rawValue) activity.title = article.title diff --git a/iOS/AppCoordinator.swift b/iOS/AppCoordinator.swift index ea6dd2fdc..8b93ff480 100644 --- a/iOS/AppCoordinator.swift +++ b/iOS/AppCoordinator.swift @@ -1179,7 +1179,7 @@ private extension AppCoordinator { guard let article = currentArticle else { return } - readActivity = ActivityFactory.make(article) + readActivity = ActivityManager.shared.makeReadArticleActivity(article) readActivity?.becomeCurrent() }