From 4b66a7562e971e2ac32d00020a1fe28a7a98610b Mon Sep 17 00:00:00 2001 From: Nathan Mattes Date: Fri, 3 Jan 2025 12:10:48 +0100 Subject: [PATCH] Remove LegacyItem (#2453) --- deltachat-ios.xcodeproj/project.pbxproj | 16 ++++------------ .../UIAction+Extension.swift} | 11 ----------- 2 files changed, 4 insertions(+), 23 deletions(-) rename deltachat-ios/{Helper/Menu/LegacyMenuItem.swift => Extensions/UIAction+Extension.swift} (76%) diff --git a/deltachat-ios.xcodeproj/project.pbxproj b/deltachat-ios.xcodeproj/project.pbxproj index 2874b562a..49fdbf6a3 100644 --- a/deltachat-ios.xcodeproj/project.pbxproj +++ b/deltachat-ios.xcodeproj/project.pbxproj @@ -216,7 +216,7 @@ D8083AD12D143868005DCB7D /* UserDefaults+Widgets.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8083ACF2D14384F005DCB7D /* UserDefaults+Widgets.swift */; }; D80F62792B59D1CC00877059 /* DefaultReactions.swift in Sources */ = {isa = PBXBuildFile; fileRef = D80F62782B59D1CC00877059 /* DefaultReactions.swift */; }; D82AD24D2D27E47A009D6026 /* UIApplication+Orientation.swift in Sources */ = {isa = PBXBuildFile; fileRef = D82AD24C2D27E47A009D6026 /* UIApplication+Orientation.swift */; }; - D84738D22BBC1C2C00ECD52B /* LegacyMenuItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = D84738D12BBC1C2C00ECD52B /* LegacyMenuItem.swift */; }; + D84738D22BBC1C2C00ECD52B /* UIAction+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = D84738D12BBC1C2C00ECD52B /* UIAction+Extension.swift */; }; D84AED242B55E8EB00D753F6 /* ReactionsOverviewViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D84AED232B55E8EB00D753F6 /* ReactionsOverviewViewController.swift */; }; D84AED272B566C0700D753F6 /* ReactionsOverviewTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D84AED262B566C0700D753F6 /* ReactionsOverviewTableViewCell.swift */; }; D85DF9782C4A96CB00A01408 /* UserDefaults+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = D85DF9772C4A96CB00A01408 /* UserDefaults+Extensions.swift */; }; @@ -634,7 +634,7 @@ D8083ACF2D14384F005DCB7D /* UserDefaults+Widgets.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UserDefaults+Widgets.swift"; sourceTree = ""; }; D80F62782B59D1CC00877059 /* DefaultReactions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DefaultReactions.swift; sourceTree = ""; }; D82AD24C2D27E47A009D6026 /* UIApplication+Orientation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIApplication+Orientation.swift"; sourceTree = ""; }; - D84738D12BBC1C2C00ECD52B /* LegacyMenuItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LegacyMenuItem.swift; sourceTree = ""; }; + D84738D12BBC1C2C00ECD52B /* UIAction+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIAction+Extension.swift"; sourceTree = ""; }; D84AED232B55E8EB00D753F6 /* ReactionsOverviewViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReactionsOverviewViewController.swift; sourceTree = ""; }; D84AED262B566C0700D753F6 /* ReactionsOverviewTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReactionsOverviewTableViewCell.swift; sourceTree = ""; }; D85DF9772C4A96CB00A01408 /* UserDefaults+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UserDefaults+Extensions.swift"; sourceTree = ""; }; @@ -762,6 +762,7 @@ isa = PBXGroup; children = ( AEE56D7F225504DB007DC082 /* Extensions.swift */, + D84738D12BBC1C2C00ECD52B /* UIAction+Extension.swift */, 78E45E4321D3F14A00D4B15E /* UIImage+Extension.swift */, 305961832346125000C80F33 /* UIEdgeInsets+Extensions.swift */, 305961862346125000C80F33 /* NSAttributedString+Extensions.swift */, @@ -1099,7 +1100,6 @@ AE851AC2227C695000ED86F0 /* Helper */ = { isa = PBXGroup; children = ( - D84738D02BBC1C2000ECD52B /* Menu */, 30238CFE28A5554C00EF14AC /* FileHelper.swift */, 3067AAC52667F3FE00525036 /* ImageFormat.swift */, 305702A024C6453700D84EFC /* TypeAlias.swift */, @@ -1209,14 +1209,6 @@ path = "Send Reaction"; sourceTree = ""; }; - D84738D02BBC1C2000ECD52B /* Menu */ = { - isa = PBXGroup; - children = ( - D84738D12BBC1C2C00ECD52B /* LegacyMenuItem.swift */, - ); - path = Menu; - sourceTree = ""; - }; D84AED252B566BF700D753F6 /* Reactions */ = { isa = PBXGroup; children = ( @@ -1714,7 +1706,7 @@ 78ED838321D5379000243125 /* TextFieldCell.swift in Sources */, 305702A124C6453700D84EFC /* TypeAlias.swift in Sources */, AE19887523EB264000B4CD5F /* HelpViewController.swift in Sources */, - D84738D22BBC1C2C00ECD52B /* LegacyMenuItem.swift in Sources */, + D84738D22BBC1C2C00ECD52B /* UIAction+Extension.swift in Sources */, AE0D26FD1FB1FE88002FAFCE /* ChatListViewController.swift in Sources */, 30C7D5EC28F47E620078D24C /* InitialsBadge.swift in Sources */, D8CDEFE02C087CDA00146773 /* ContactCardCell.swift in Sources */, diff --git a/deltachat-ios/Helper/Menu/LegacyMenuItem.swift b/deltachat-ios/Extensions/UIAction+Extension.swift similarity index 76% rename from deltachat-ios/Helper/Menu/LegacyMenuItem.swift rename to deltachat-ios/Extensions/UIAction+Extension.swift index b70104ac8..82661b3dd 100644 --- a/deltachat-ios/Helper/Menu/LegacyMenuItem.swift +++ b/deltachat-ios/Extensions/UIAction+Extension.swift @@ -1,16 +1,5 @@ import UIKit -@available(*, deprecated) -class LegacyMenuItem: UIMenuItem { - var indexPath: IndexPath? - - convenience init(title: String, action: Selector, indexPath: IndexPath?) { - self.init(title: title, action: action) - - self.indexPath = indexPath - } -} - extension UIAction { static func menuAction(localizationKey: String, attributes: UIAction.Attributes = [], systemImageName: String, indexPath: IndexPath, action: @escaping (IndexPath) -> Void) -> UIAction { return menuAction(localizationKey: localizationKey, attributes: attributes, image: UIImage(systemName: systemImageName), indexPath: indexPath, action: action)