<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIShape-swift.struct/rect(cornerRadius:cornerCurve:maskedCorners:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "s:5UIKit7UIShapeV4rect12cornerRadius0D5Curve13maskedCornersAC14CoreFoundation7CGFloatV_So08UICornerF0VSo12UIRectCornerVtFZ"
  },
  "title" : "rect(cornerRadius:cornerCurve:maskedCorners:)"
}
-->

# rect(cornerRadius:cornerCurve:maskedCorners:)

Creates a rectangular shape with rounded corners, using the provided corner radius, corner curve, and rectangle corners.

```
static func rect(cornerRadius: CGFloat, cornerCurve: UICornerCurve = .automatic, maskedCorners: UIRectCorner = .allCorners) -> UIShape
```

---

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)