How can I replicate CALayer.maskedCorners with UIButtonConfiguration and UIBackgroundConfiguration?

WWDC 2021 session 10064 introduced UIButtonConfiguration, a new way to configure the visual appearance of buttons, for iOS 15. I'm now in the process of switching all my button setup over to UIButtonConfiguration, and I've run into one situation where it doesn't apply: rounding specific corners of the button. CALayer has the maskedCorners property that lets you round or mask specific corners but not others. In transferring border radius, border width, and border color styling over to UIButtonConfiguration via UIBackgroundConfiguration, I don't see an equivalent UI. Am I missing something?

For now, in cases when I need the maskedCorners functionality, I'm falling back to using the layer for border properties.

Replies

There isn't, but feel free to feedback request!

Add a Comment