From 10039cf972ebde9404181e1f8cca1654e6ca9044 Mon Sep 17 00:00:00 2001 From: Ryan Lintott <2143656+ryanlintott@users.noreply.github.com> Date: Wed, 2 Sep 2026 16:27:10 -0400 Subject: [PATCH 1/2] Replaced soft-deprecated SwiftUI APIs with their modern equivalents Changed .overlay(_:) and .mask(_:) to their trailing-closure forms and .accessibility(hidden:) to .accessibilityHidden(_:). All replacements are available at the package's minimum deployment targets. The overlay change also guards against the SDK 27 @ContentBuilder unification, which removes the View constraint from result builders and makes the direct-argument form of overlay ambiguous for ShapeStyle expressions carrying .opacity() or .blendMode(). The trailing-closure form is Apple's documented fix. --- .../ShapeUp/Emboss/EmbossViewModifier.swift | 34 +++++++++---------- .../InsettableShape+publicExtensions.swift | 4 +-- .../View+publicExtensions.swift | 8 ++--- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/Sources/ShapeUp/Emboss/EmbossViewModifier.swift b/Sources/ShapeUp/Emboss/EmbossViewModifier.swift index c51247f..e2efcf0 100644 --- a/Sources/ShapeUp/Emboss/EmbossViewModifier.swift +++ b/Sources/ShapeUp/Emboss/EmbossViewModifier.swift @@ -29,49 +29,49 @@ struct EmbossViewModifier: ViewModifier { func body(content: Content) -> some View { content .opacity(baseColor == nil ? 1 : 0) - .overlay( + .overlay { ZStack { baseColor Color.white .accessibilityIgnoresInvertColors() - .mask( + .mask { Color.white - .overlay( + .overlay { Color.black - .mask( + .mask { content .offset(x: offsetX, y: offsetY) - ) - ) + } + } .blur(radius: blur) .drawingGroup() .luminanceToAlpha() - ) + } .opacity(opacity) .allowsHitTesting(false) - .accessibility(hidden: true) + .accessibilityHidden(true) Color.black .accessibilityIgnoresInvertColors() - .mask( + .mask { Color.white - .overlay( + .overlay { Color.black - .mask( + .mask { content .offset(x: -offsetX, y: -offsetY) - ) - ) + } + } .blur(radius: blur) .drawingGroup() .luminanceToAlpha() - ) + } .opacity(opacity) .allowsHitTesting(false) - .accessibility(hidden: true) + .accessibilityHidden(true) } - ) - .mask(content) + } + .mask { content } } } diff --git a/Sources/ShapeUp/_Extension-Public/InsettableShape+publicExtensions.swift b/Sources/ShapeUp/_Extension-Public/InsettableShape+publicExtensions.swift index 6185413..e19cad2 100644 --- a/Sources/ShapeUp/_Extension-Public/InsettableShape+publicExtensions.swift +++ b/Sources/ShapeUp/_Extension-Public/InsettableShape+publicExtensions.swift @@ -28,7 +28,7 @@ public extension InsettableShape { return self .fill(backgroundColor) - .overlay( + .overlay { ZStack { self .inset(by: inset) @@ -43,7 +43,7 @@ public extension InsettableShape { .accessibilityIgnoresInvertColors() .clipShape(self) .blendMode(.overlay) - ) + } } /// Returns a view with debossed edges that matches the parent shape. diff --git a/Sources/ShapeUp/_Extension-Public/View+publicExtensions.swift b/Sources/ShapeUp/_Extension-Public/View+publicExtensions.swift index c848dd6..a539082 100644 --- a/Sources/ShapeUp/_Extension-Public/View+publicExtensions.swift +++ b/Sources/ShapeUp/_Extension-Public/View+publicExtensions.swift @@ -21,11 +21,11 @@ public extension View { /// - Returns: The same view with an overlayed embossed effect using edges of a supplied shape. func emboss(using shape: S, size: CGFloat, angle: Angle? = nil, opacity: Double? = nil) -> some View where S : InsettableShape { self - .overlay( + .overlay { shape .embossEdges(size: size, angle: angle, opacity: opacity) .allowsHitTesting(false) - ) + } } /// Returns the same view with an overlayed debossed effect using edges of a supplied shape. @@ -41,11 +41,11 @@ public extension View { /// - Returns: The same view with an overlayed debossed effect using edges of a supplied shape. func deboss(using shape: S, size: CGFloat, angle: Angle? = nil, opacity: Double? = nil) -> some View where S : InsettableShape { self - .overlay( + .overlay { shape .debossEdges(size: size, angle: angle, opacity: opacity) .allowsHitTesting(false) - ) + } } /// Returns the same view with an overlayed embossed effect. From 07e6cdb0f5338bc7333d8f56c11e77e0cd5cff6a Mon Sep 17 00:00:00 2001 From: Ryan Lintott <2143656+ryanlintott@users.noreply.github.com> Date: Thu, 3 Sep 2026 00:58:04 -0400 Subject: [PATCH 2/2] Added Sendable conformance to CGFrame CGFrame conforms to CGFrameRepresentable, which is a plain protocol, so it got no Sendable conformance despite being composed entirely of Sendable parts. Public types do not get one implicitly. The shape types do not need this. SwiftUI declares Shape as refining Sendable, so CornerCustom, RelativeCornerCustom, CornerRectangle, CornerTriangle, CornerPentagon, SketchyLine and SketchyLines already conform transitively through Shape and InsettableShape. --- Sources/ShapeUp/Rect/CGFrame.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/ShapeUp/Rect/CGFrame.swift b/Sources/ShapeUp/Rect/CGFrame.swift index 27572e1..dd11d5e 100644 --- a/Sources/ShapeUp/Rect/CGFrame.swift +++ b/Sources/ShapeUp/Rect/CGFrame.swift @@ -113,7 +113,7 @@ public extension CGFrameRepresentable { /// A coordinate frame defined by an origin and a vector for each axis. -public struct CGFrame: CGFrameRepresentable { +public struct CGFrame: CGFrameRepresentable, Sendable { /// The origin point of the coordinate frame. public var origin: CGPoint /// The vector defining the x-axis direction and magnitude.