<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 26.0.0 -",
    "watchOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/RoundedRectangularShape/corners(in:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI23RoundedRectangularShapeP7corners2inAA0cdE7CornersVSgSo6CGSizeVSg_tF"
  },
  "title" : "corners(in:)"
}
-->

# corners(in:)

Resolved corners given a size. If the corner style of a shape is
size-dependent, read the provided size and return values accordingly.
This function could be called with a nil size when the size hasn’t been
determined. In that case, return the best approximated value.
For example, for a capsule shape, its corner radius is determined by the
size. If size is not available, return `.fixed(.infinity)` to indicate
that the corner should be as round as it could be.

```
func corners(in size: CGSize?) -> Self.Corners?
```

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)