<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/StrokeStyle/init(lineWidth:lineCap:lineJoin:miterLimit:dash:dashPhase:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI11StrokeStyleV9lineWidth0E3Cap0E4Join10miterLimit4dash0K5PhaseAC14CoreFoundation7CGFloatV_So06CGLineG0VSo0pH0VALSayALGALtcfc"
  },
  "title" : "init(lineWidth:lineCap:lineJoin:miterLimit:dash:dashPhase:)"
}
-->

# init(lineWidth:lineCap:lineJoin:miterLimit:dash:dashPhase:)

Creates a new stroke style from the given components.

```
init(lineWidth: CGFloat = 1, lineCap: CGLineCap = .butt, lineJoin: CGLineJoin = .miter, miterLimit: CGFloat = 10, dash: [CGFloat] = [CGFloat](), dashPhase: CGFloat = 0)
```

## Parameters

`lineWidth`

The width of the segment.

`lineCap`

The endpoint style of a segment.

`lineJoin`

The join type of a segment.

`miterLimit`

The threshold used to determine whether to use a bevel
instead of a miter at a join.

`dash`

The lengths of painted and unpainted segments used to make a
dashed line.

`dashPhase`

How far into the dash pattern the line starts.

---

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)