.accessibilityShowButtonShapes deprecated - How to correctly handle conflicts with .glassEffect?

4 days ago 4
ARTICLE AD BOX

Perhaps the reason why the environment variable is deprecated is because the concept of button shapes no longer exists in iOS 26. The setting is now labelled "Show Borders".

Previously, button shapes added a shaded area around a button and also increased its size. Now, a button with .automatic styling is still shown with .bordered styling, but a button with .glass styling gets a distinct border shown around it, which probably doesn't change its size.

The environment value accessibilityShowBorders seems to reflect the new setting. This environment value is supported for iOS 14+. The documentation says:

If this property’s value is true, interactive custom controls such as buttons should be drawn in such a way that their edges and borders are clearly visible.

This is the same as the description to the old value accessibilityShowButtonShapes.

Lo and behold, if you navigate to the source definition of the old value in Xcode, it looks like this:

@available(iOS, introduced: 14.0, deprecated: 1000, renamed: "accessibilityShowBorders") @available(macOS, introduced: 11.0, deprecated: 1000, renamed: "accessibilityShowBorders") @available(tvOS, introduced: 14.0, deprecated: 1000, renamed: "accessibilityShowBorders") @available(watchOS, introduced: 7.0, deprecated: 1000, renamed: "accessibilityShowBorders") @available(visionOS, introduced: 1.0, deprecated: 1000, renamed: "accessibilityShowBorders") extension EnvironmentValues { /// Whether the system preference for Show Button Shapes is enabled. /// /// If this property's value is true, interactive custom controls /// such as buttons should be drawn in such a way that their edges /// and borders are clearly visible. public var accessibilityShowButtonShapes: Bool { get } }

So this confirms that accessibilityShowBorders is the replacement for accessibilityShowButtonShapes.

Navigating to the definition of the new value, you can see that it has been back-deployed to earlier versions:

@available(iOS 14.0, macOS 11.0, tvOS 14.0, watchOS 7.0, *) extension EnvironmentValues { /// Whether the system preference for Show Borders is enabled. /// On macOS this is true when Increased Contrast is enabled. /// /// If this property's value is true, interactive custom controls /// such as buttons should be drawn in such a way that their edges /// and borders are clearly visible. @backDeployed(before: iOS 26.1, macOS 26.1, tvOS 26.1, watchOS 26.1, visionOS 26.1) public var accessibilityShowBorders: Bool { get } }

To see it, you probably need to be running a recent version of Xcode. It certainly works with Xcode 26.2.

Read Entire Article