<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreGraphics",
  "identifier" : "/documentation/CoreGraphics/CGLineCap",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "Core Graphics"
    ],
    "preciseIdentifier" : "c:@E@CGLineCap"
  },
  "title" : "CGLineCap"
}
-->

# CGLineCap

Styles for rendering the endpoint of a stroked line.

```
enum CGLineCap
```

## Overview

A line cap specifies the method used by [`strokePath()`](/documentation/CoreGraphics/CGContext/strokePath()) to draw the endpoint of the line. To change the line cap style in a graphics context, you use the function [`setLineCap(_:)`](/documentation/CoreGraphics/CGContext/setLineCap(_:)).

## Topics

### Constants

[`CGLineCap.butt`](/documentation/CoreGraphics/CGLineCap/butt)

A line with a squared-off end. Core Graphics draws the line to extend only to the exact endpoint of the path. This is the default.

[`CGLineCap.round`](/documentation/CoreGraphics/CGLineCap/round)

A line with a rounded end. Core Graphics draws the line to extend beyond the endpoint of the path. The line ends with a semicircular arc with a radius of 1/2 the line’s width, centered on the endpoint.

[`CGLineCap.square`](/documentation/CoreGraphics/CGLineCap/square)

A line with a squared-off end. Core Graphics extends the line beyond the endpoint of the path for a distance equal to half the line width.



---

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)