From 5a93184c6d2d4e2788229c05196d2accfa8a79d7 Mon Sep 17 00:00:00 2001 From: Thomas Ricouard Date: Sat, 4 May 2024 11:34:51 +0200 Subject: [PATCH] Rename Intent --- IceCubesApp.xcodeproj/project.pbxproj | 8 ++++---- IceCubesApp/App/Main/IceCubesApp+Scene.swift | 2 +- IceCubesAppIntents/AppShortcuts.swift | 2 +- .../{PostPhotoIntent.swift => PostImageIntent.swift} | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) rename IceCubesAppIntents/{PostPhotoIntent.swift => PostImageIntent.swift} (94%) diff --git a/IceCubesApp.xcodeproj/project.pbxproj b/IceCubesApp.xcodeproj/project.pbxproj index 7e52c1a5..318216fb 100644 --- a/IceCubesApp.xcodeproj/project.pbxproj +++ b/IceCubesApp.xcodeproj/project.pbxproj @@ -45,7 +45,7 @@ 9F37BDDB2BE36E22007F28AD /* PostIntent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F37BDDA2BE36E22007F28AD /* PostIntent.swift */; }; 9F37BDDD2BE37193007F28AD /* AppIntentService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F37BDDC2BE37193007F28AD /* AppIntentService.swift */; }; 9F37BDDF2BE37C35007F28AD /* TabIntent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F37BDDE2BE37C35007F28AD /* TabIntent.swift */; }; - 9F37BDE12BE38646007F28AD /* PostPhotoIntent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F37BDE02BE38646007F28AD /* PostPhotoIntent.swift */; }; + 9F37BDE12BE38646007F28AD /* PostImageIntent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F37BDE02BE38646007F28AD /* PostImageIntent.swift */; }; 9F37BDE32BE393A7007F28AD /* AppShortcuts.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F37BDE22BE393A7007F28AD /* AppShortcuts.swift */; }; 9F38A7332ACEA26100DBCD66 /* Localizable.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = 9F38A7322ACEA26100DBCD66 /* Localizable.xcstrings */; }; 9F38A7342ACEA26100DBCD66 /* Localizable.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = 9F38A7322ACEA26100DBCD66 /* Localizable.xcstrings */; }; @@ -204,7 +204,7 @@ 9F37BDDA2BE36E22007F28AD /* PostIntent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PostIntent.swift; sourceTree = ""; }; 9F37BDDC2BE37193007F28AD /* AppIntentService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppIntentService.swift; sourceTree = ""; }; 9F37BDDE2BE37C35007F28AD /* TabIntent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabIntent.swift; sourceTree = ""; }; - 9F37BDE02BE38646007F28AD /* PostPhotoIntent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PostPhotoIntent.swift; sourceTree = ""; }; + 9F37BDE02BE38646007F28AD /* PostImageIntent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PostImageIntent.swift; sourceTree = ""; }; 9F37BDE22BE393A7007F28AD /* AppShortcuts.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppShortcuts.swift; sourceTree = ""; }; 9F38A7322ACEA26100DBCD66 /* Localizable.xcstrings */ = {isa = PBXFileReference; lastKnownFileType = text.json.xcstrings; path = Localizable.xcstrings; sourceTree = ""; }; 9F398AA32935F90100A889F2 /* Models */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = Models; path = Packages/Models; sourceTree = ""; }; @@ -365,7 +365,7 @@ 9F37BDDA2BE36E22007F28AD /* PostIntent.swift */, 9F37BDDC2BE37193007F28AD /* AppIntentService.swift */, 9F37BDDE2BE37C35007F28AD /* TabIntent.swift */, - 9F37BDE02BE38646007F28AD /* PostPhotoIntent.swift */, + 9F37BDE02BE38646007F28AD /* PostImageIntent.swift */, 9F37BDE22BE393A7007F28AD /* AppShortcuts.swift */, ); path = IceCubesAppIntents; @@ -853,7 +853,7 @@ 9F35DB4C2952005C00B3281A /* MessagesTab.swift in Sources */, 9F37BDDB2BE36E22007F28AD /* PostIntent.swift in Sources */, 9F37BDDD2BE37193007F28AD /* AppIntentService.swift in Sources */, - 9F37BDE12BE38646007F28AD /* PostPhotoIntent.swift in Sources */, + 9F37BDE12BE38646007F28AD /* PostImageIntent.swift in Sources */, 9F37BDDF2BE37C35007F28AD /* TabIntent.swift in Sources */, 9FAD85CF2975B68900496AB1 /* SideBarView.swift in Sources */, 9FAE4ACB293783B000772766 /* SettingsTab.swift in Sources */, diff --git a/IceCubesApp/App/Main/IceCubesApp+Scene.swift b/IceCubesApp/App/Main/IceCubesApp+Scene.swift index 8b99bf0b..47857f41 100644 --- a/IceCubesApp/App/Main/IceCubesApp+Scene.swift +++ b/IceCubesApp/App/Main/IceCubesApp+Scene.swift @@ -137,7 +137,7 @@ extension IceCubesApp { #endif } else if let tabIntent = appIntentService.handledIntent?.intent as? TabIntent { selectedTab = tabIntent.tab.toAppTab - } else if let imageIntent = appIntentService.handledIntent?.intent as? PostPhotoIntent, + } else if let imageIntent = appIntentService.handledIntent?.intent as? PostImageIntent, let urls = imageIntent.images?.compactMap({ $0.fileURL }) { appRouterPath.presentedSheet = .imageURL(urls: urls, visibility: userPreferences.postVisibility) diff --git a/IceCubesAppIntents/AppShortcuts.swift b/IceCubesAppIntents/AppShortcuts.swift index 080a527d..89610263 100644 --- a/IceCubesAppIntents/AppShortcuts.swift +++ b/IceCubesAppIntents/AppShortcuts.swift @@ -22,7 +22,7 @@ struct AppShortcuts: AppShortcutsProvider { systemImageName: "cube" ) AppShortcut( - intent: PostPhotoIntent(), + intent: PostImageIntent(), phrases: [ "Post images \(\.$images) in \(.applicationName)", "Send photos \(\.$images) with \(.applicationName)", diff --git a/IceCubesAppIntents/PostPhotoIntent.swift b/IceCubesAppIntents/PostImageIntent.swift similarity index 94% rename from IceCubesAppIntents/PostPhotoIntent.swift rename to IceCubesAppIntents/PostImageIntent.swift index 030d7420..407e3f75 100644 --- a/IceCubesAppIntents/PostPhotoIntent.swift +++ b/IceCubesAppIntents/PostImageIntent.swift @@ -1,7 +1,7 @@ import Foundation import AppIntents -struct PostPhotoIntent: AppIntent { +struct PostImageIntent: AppIntent { static let title: LocalizedStringResource = "Post an image to Mastodon" static var description: IntentDescription { get {