diff --git a/WireUI/Sources/WireDesign/Icons/Image+ImageResource.swift b/WireUI/Sources/WireDesign/Icons/Image+ImageResource.swift deleted file mode 100644 index 64f1f3de891..00000000000 --- a/WireUI/Sources/WireDesign/Icons/Image+ImageResource.swift +++ /dev/null @@ -1,23 +0,0 @@ -// -// Wire -// Copyright (C) 2025 Wire Swiss GmbH -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see http://www.gnu.org/licenses/. -// - -import SwiftUI - -public extension Image { - static let close = Image(.close) -} diff --git a/WireUI/Sources/WireDesign/Icons/UImage+ImageResource.swift b/WireUI/Sources/WireDesign/Icons/UImage+ImageResource.swift deleted file mode 100644 index 162b91a6107..00000000000 --- a/WireUI/Sources/WireDesign/Icons/UImage+ImageResource.swift +++ /dev/null @@ -1,23 +0,0 @@ -// -// Wire -// Copyright (C) 2025 Wire Swiss GmbH -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see http://www.gnu.org/licenses/. -// - -import UIKit - -public extension UIImage { - static let close = UIImage(resource: .close) -} diff --git a/WireUI/Sources/WireFolderPickerUI/FolderPicker.swift b/WireUI/Sources/WireFolderPickerUI/FolderPicker.swift index b020997adea..6b33501b292 100644 --- a/WireUI/Sources/WireFolderPickerUI/FolderPicker.swift +++ b/WireUI/Sources/WireFolderPickerUI/FolderPicker.swift @@ -63,14 +63,10 @@ public struct FolderPicker: View { .toolbar { if showCloseButton { ToolbarItem(placement: .topBarTrailing) { - CloseButton( - action: didTapClose, - accessibilityLabel: String( - localized: "folderPicker.close.label", - table: "Accessibility", - bundle: .module + CloseButton(action: didTapClose) + .accessibilityLabel( + Text("folderPicker.close.label", tableName: "Accessibility", bundle: .module) ) - ) } } } diff --git a/WireUI/Sources/WireMoveToFolderUI/Views/FolderPicker/FolderPicker.swift b/WireUI/Sources/WireMoveToFolderUI/Views/FolderPicker/FolderPicker.swift index 64a825a3c3b..0fd1b7c0b3d 100644 --- a/WireUI/Sources/WireMoveToFolderUI/Views/FolderPicker/FolderPicker.swift +++ b/WireUI/Sources/WireMoveToFolderUI/Views/FolderPicker/FolderPicker.swift @@ -50,14 +50,10 @@ public struct FolderPicker: View { .navigationBarTitleDisplayMode(.inline) .toolbar { ToolbarItem(placement: .navigationBarLeading) { - CloseButton( - action: didTapClose, - accessibilityLabel: String( - localized: "folderPicker.close.label", - table: "Accessibility", - bundle: .module + CloseButton(action: didTapClose) + .accessibilityLabel( + Text("folderPicker.close.label", tableName: "Accessibility", bundle: .module) ) - ) } ToolbarItem(placement: .navigationBarTrailing) { NavigationLink { diff --git a/WireUI/Sources/WireReusableUIComponents/Buttons/CloseButton.swift b/WireUI/Sources/WireReusableUIComponents/Buttons/CloseButton.swift index 9bfd47fde46..d4ddbcfac05 100644 --- a/WireUI/Sources/WireReusableUIComponents/Buttons/CloseButton.swift +++ b/WireUI/Sources/WireReusableUIComponents/Buttons/CloseButton.swift @@ -22,21 +22,18 @@ import WireDesign public struct CloseButton: View { private let action: () -> Void - private let accessibilityLabel: String public var body: some View { Button(action: action) { - Image.close + Image(.close) } .buttonStyle(.plain) .foregroundColor(Color(uiColor: SemanticColors.Icon.foregroundDefaultBlack)) - .accessibilityLabel(Text(accessibilityLabel)) .accessibilityIdentifier("close") } - public init(action: @escaping @MainActor () -> Void, accessibilityLabel: String) { + public init(action: @escaping @MainActor () -> Void) { self.action = action - self.accessibilityLabel = accessibilityLabel } } @@ -46,7 +43,7 @@ public struct CloseButton: View { Text("Hello, World!") .toolbar { ToolbarItem(placement: .topBarTrailing) { - CloseButton(action: { print("Close") }, accessibilityLabel: "Close") + CloseButton { print("Close") } } } } diff --git a/WireUI/Sources/WireDesign/Resources/Images.xcassets/Contents.json b/WireUI/Sources/WireReusableUIComponents/Resources/Images.xcassets/Contents.json similarity index 100% rename from WireUI/Sources/WireDesign/Resources/Images.xcassets/Contents.json rename to WireUI/Sources/WireReusableUIComponents/Resources/Images.xcassets/Contents.json diff --git a/WireUI/Sources/WireDesign/Resources/Images.xcassets/Icons/Close.imageset/Contents.json b/WireUI/Sources/WireReusableUIComponents/Resources/Images.xcassets/Icons/Close.imageset/Contents.json similarity index 100% rename from WireUI/Sources/WireDesign/Resources/Images.xcassets/Icons/Close.imageset/Contents.json rename to WireUI/Sources/WireReusableUIComponents/Resources/Images.xcassets/Icons/Close.imageset/Contents.json diff --git a/WireUI/Sources/WireDesign/Resources/Images.xcassets/Icons/Close.imageset/Icon.svg b/WireUI/Sources/WireReusableUIComponents/Resources/Images.xcassets/Icons/Close.imageset/Icon.svg similarity index 100% rename from WireUI/Sources/WireDesign/Resources/Images.xcassets/Icons/Close.imageset/Icon.svg rename to WireUI/Sources/WireReusableUIComponents/Resources/Images.xcassets/Icons/Close.imageset/Icon.svg diff --git a/WireUI/Sources/WireDesign/Resources/Images.xcassets/Icons/Contents.json b/WireUI/Sources/WireReusableUIComponents/Resources/Images.xcassets/Icons/Contents.json similarity index 100% rename from WireUI/Sources/WireDesign/Resources/Images.xcassets/Icons/Contents.json rename to WireUI/Sources/WireReusableUIComponents/Resources/Images.xcassets/Icons/Contents.json diff --git a/WireUI/Sources/WireReusableUIComponents/SDKExtensions/UIKit/UIBarButtonItem+CloseButton.swift b/WireUI/Sources/WireReusableUIComponents/SDKExtensions/UIKit/UIBarButtonItem+CloseButton.swift index 2b1f403e0cd..8429d6e3bc7 100644 --- a/WireUI/Sources/WireReusableUIComponents/SDKExtensions/UIKit/UIBarButtonItem+CloseButton.swift +++ b/WireUI/Sources/WireReusableUIComponents/SDKExtensions/UIKit/UIBarButtonItem+CloseButton.swift @@ -31,7 +31,7 @@ public extension UIBarButtonItem { /// /// - Returns: A UIBarButtonItem configured as a close button. static func closeButton(action: UIAction, accessibilityLabel: String) -> UIBarButtonItem { - let closeImage = UIImage.close + let closeImage = UIImage(resource: .close) let closeItem = UIBarButtonItem(title: accessibilityLabel, primaryAction: action) diff --git a/wire-ios-mono.xcworkspace/xcshareddata/swiftpm/Package.resolved b/wire-ios-mono.xcworkspace/xcshareddata/swiftpm/Package.resolved index 3ee62e58e0b..6d68ffbea4c 100644 --- a/wire-ios-mono.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/wire-ios-mono.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -6,8 +6,8 @@ "repositoryURL": "https://github.com/openid/AppAuth-iOS.git", "state": { "branch": null, - "revision": "c89ed571ae140f8eb1142735e6e23d7bb8c34cb2", - "version": "1.7.5" + "revision": "2781038865a80e2c425a1da12cc1327bcd56501f", + "version": "1.7.6" } }, { @@ -141,8 +141,8 @@ "repositoryURL": "https://github.com/apple/swift-log", "state": { "branch": null, - "revision": "9cb486020ebf03bfa5b5df985387a14a98744537", - "version": "1.6.1" + "revision": "96a2f8a0fa41e9e09af4585e2724c4e825410b91", + "version": "1.6.2" } }, { diff --git a/wire-ios/Wire-iOS/Sources/UserInterface/DeviceView/Views/E2EIdentityCertificateDetailsView.swift b/wire-ios/Wire-iOS/Sources/UserInterface/DeviceView/Views/E2EIdentityCertificateDetailsView.swift index d9369b5147d..2952ca59f27 100644 --- a/wire-ios/Wire-iOS/Sources/UserInterface/DeviceView/Views/E2EIdentityCertificateDetailsView.swift +++ b/wire-ios/Wire-iOS/Sources/UserInterface/DeviceView/Views/E2EIdentityCertificateDetailsView.swift @@ -19,6 +19,7 @@ import SwiftUI import WireCommonComponents import WireDesign +import WireReusableUIComponents struct E2EIdentityCertificateDetailsView: View { @Environment(\.dismiss) private var dismiss @@ -44,18 +45,12 @@ struct E2EIdentityCertificateDetailsView: View { .overlay { HStack { Spacer() - Button( - action: { - dismiss() - didDismiss?() - }, - label: { - Image - .close - .foregroundColor(Color(uiColor: SemanticColors.Icon.foregroundDefaultBlack)) - } - ) + CloseButton { + dismiss() + didDismiss?() + } .accessibilityIdentifier("CloseButton") + .accessibilityLabel(Text(L10n.Localizable.General.close)) .padding(.all, ViewConstants.Padding.standard) } }