Are there SwiftUI APIs for getting the corner radius of the device or the window on macOS?

Asked on 2025-07-10

1 search

Yes, there are SwiftUI APIs that help with corner radius management, particularly in the context of maintaining concentricity with the container's corners. This is referred to as "corner concentricity," where elements like buttons align their corners with the corners of their container, such as a sheet or window. To achieve this, you can use a concentric rectangle shape and pass the container concentric configuration to the corner parameter. This ensures that the corners of your UI elements are aligned with the corners of their containers, providing a consistent and harmonious design.

For more details, you can refer to the session Build a SwiftUI app with the new design (16:20).