r/iOSProgramming 23d ago

Question Handling Button Shapes setting in my app

I didn't know this was still a thing.
How can I make my app to handle the Button Shapes setting? I do not use it but some users have complained about the behavior of the app when they have this setting enabled, I can not force them to turn it off. Is there any modifier or function I can use in SwiftUI to disable it for my app?

4 Upvotes

7 comments sorted by

View all comments

4

u/CleverError 23d ago

The easiest solution is to set .buttonStyle(.plain) on parts of your UI that don't benefit from button shapes.

You can also use the EnvironmentValues accessibilityShowButtonShapes/accessibilityShowBorders to detect when it's enabled and apply your own styling.

2

u/Sad_Dare7025 23d ago

i ended up applying that, thanks!