From 8f3bb578c6c79c1473c2a645ebf9464914c88771 Mon Sep 17 00:00:00 2001 From: John Szumski Date: Mon, 22 Sep 2025 13:37:16 -0400 Subject: [PATCH 1/3] Fix warning by removing reference to non-existent Resources directory --- CHANGELOG.md | 2 ++ Package.swift | 3 --- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e4af49b0..60d57574 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ### Fixed +- Fixed warning in Package.swift referencing a non-existent Resources directory. + ### Added ### Removed diff --git a/Package.swift b/Package.swift index 314dabfd..9c2e7f8b 100644 --- a/Package.swift +++ b/Package.swift @@ -46,9 +46,6 @@ let package = Package( path: "BlueprintUILists", exclude: [ "Tests", - ], - resources: [ - .process("Resources"), ] ), ], From 2bfcb39be65d34b14898981fada92903be977d10 Mon Sep 17 00:00:00 2001 From: John Szumski Date: Mon, 22 Sep 2025 13:38:48 -0400 Subject: [PATCH 2/3] Fix warning for a cross-module conformance --- CHANGELOG.md | 1 + ListableUI/Sources/ListScrollPositionInfo.swift | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 60d57574..d235d791 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ### Fixed - Fixed warning in Package.swift referencing a non-existent Resources directory. +- Fixed warning for a cross-module protocol conformance. ### Added diff --git a/ListableUI/Sources/ListScrollPositionInfo.swift b/ListableUI/Sources/ListScrollPositionInfo.swift index 0ec59920..1823a824 100644 --- a/ListableUI/Sources/ListScrollPositionInfo.swift +++ b/ListableUI/Sources/ListScrollPositionInfo.swift @@ -173,7 +173,7 @@ extension UIEdgeInsets } } -extension UIRectEdge : CustomDebugStringConvertible +extension UIRectEdge : Swift.CustomDebugStringConvertible { static func visibleScrollViewContentEdges( bounds : CGRect, From 6fe69553fe0c96a5af5f5ce33091197ef28ca68d Mon Sep 17 00:00:00 2001 From: John Szumski Date: Mon, 22 Sep 2025 13:40:31 -0400 Subject: [PATCH 3/3] Fixed deprecation warning by adopting UIButton.Configuration for swipe action buttons. --- CHANGELOG.md | 1 + .../Sources/Internal/SwipeActionsView.swift | 35 ++++++++++++++----- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d235d791..9ca1f747 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Fixed warning in Package.swift referencing a non-existent Resources directory. - Fixed warning for a cross-module protocol conformance. +- Fixed deprecation warning by adopting `UIButton.Configuration` for swipe action buttons. ### Added diff --git a/ListableUI/Sources/Internal/SwipeActionsView.swift b/ListableUI/Sources/Internal/SwipeActionsView.swift index cde56bd6..e149c37e 100644 --- a/ListableUI/Sources/Internal/SwipeActionsView.swift +++ b/ListableUI/Sources/Internal/SwipeActionsView.swift @@ -264,13 +264,16 @@ private class DefaultSwipeActionButton: UIButton { override init(frame: CGRect) { super.init(frame: frame) - titleLabel?.font = .systemFont(ofSize: 15, weight: .medium) - titleLabel?.lineBreakMode = .byTruncatingTail + var configuration = UIButton.Configuration.plain() + configuration.contentInsets = NSDirectionalEdgeInsets(top: 0, leading: inset, bottom: 0, trailing: inset) + configuration.titleLineBreakMode = .byTruncatingTail + configuration.titleAlignment = .center + self.configuration = configuration + titleLabel?.numberOfLines = 2 titleLabel?.minimumScaleFactor = 0.8 titleLabel?.adjustsFontSizeToFitWidth = true - titleLabel?.textAlignment = .center - contentEdgeInsets = UIEdgeInsets(top: 0, left: inset, bottom: 0, right: inset) + addTarget(self, action: #selector(onTap), for: .primaryActionTriggered) } @@ -278,6 +281,24 @@ private class DefaultSwipeActionButton: UIButton { fatalError("init(coder:) has not been implemented") } + override func updateConfiguration() { + super.updateConfiguration() + + if let title = action?.title, let color = action?.tintColor { + configuration?.attributedTitle = AttributedString( + title, + attributes: AttributeContainer([ + .font: UIFont.systemFont(ofSize: 15, weight: .medium), + .foregroundColor: color, + ]), + ) + } else { + configuration?.attributedTitle = nil + } + + configuration?.image = action?.image + } + func set(action: SwipeAction, didPerformAction: @escaping SwipeAction.OnDidPerformAction) { self.action = action @@ -289,10 +310,8 @@ private class DefaultSwipeActionButton: UIButton { // an incorrect visual appearance. tintColor = action.tintColor - - setTitle(action.title, for: .normal) - setTitleColor(action.tintColor, for: .normal) - setImage(action.image, for: .normal) + + setNeedsUpdateConfiguration() accessibilityLabel = action.accessibilityLabel accessibilityValue = action.accessibilityValue