Compose SwiftUIv0.4.0
esc
GuideAPIGitHub
View

Path

The Compose SwiftUI form of SwiftUI's Path.

iOS 17.0+macOS 14.0+tvOS 17.0+watchOS 10.0+
class Path

Overview

This is the Kotlin form of SwiftUI Path: SwiftUI documentation. In Swift it reads:

@frozen struct Path

Topics

Creating a Path

fun PathView(path: Path, modifier: Modifier = Modifier)
SwiftUI Path · Renders the value as a view.

Initializers

constructor(roundedRect: CGRect, cornerSize: CGSize, style: RoundedCornerStyle = RoundedCornerStyle.continuous)
SwiftUI Path.init(roundedRect:cornerSize:style:)
constructor(roundedRect: CGRect, cornerRadii: RectangleCornerRadii, style: RoundedCornerStyle = RoundedCornerStyle.continuous)
SwiftUI Path.init(roundedRect:cornerRadii:style:)
constructor(roundedRect: CGRect, cornerRadius: Double, style: RoundedCornerStyle = RoundedCornerStyle.continuous)
SwiftUI Path.init(roundedRect:cornerRadius:style:)
constructor(ellipseIn: CGRect)
SwiftUI Path.init(ellipseIn:)
constructor()
SwiftUI Path.init()

Type properties

val closeSubpath: Path.Element
SwiftUI Path.Element.closeSubpath

Methods

fun strokedPath(style: StrokeStyle): Path
SwiftUI Path.strokedPath(_:)
fun trimmedPath(from: Double, to: Double): Path
SwiftUI Path.trimmedPath(from:to:)
fun normalized(eoFill: Boolean = true): Path
SwiftUI Path.normalized(eoFill:)
fun subtracting(other: Path, eoFill: Boolean = false): Path
SwiftUI Path.subtracting(_:eoFill:)
fun intersection(other: Path, eoFill: Boolean = false): Path
SwiftUI Path.intersection(_:eoFill:)
fun lineSubtraction(other: Path, eoFill: Boolean = false): Path
SwiftUI Path.lineSubtraction(_:eoFill:)
fun lineIntersection(other: Path, eoFill: Boolean = false): Path
SwiftUI Path.lineIntersection(_:eoFill:)
fun symmetricDifference(other: Path, eoFill: Boolean = false): Path
SwiftUI Path.symmetricDifference(_:eoFill:)
fun union(other: Path, eoFill: Boolean = false): Path
SwiftUI Path.union(_:eoFill:)
fun offsetBy(dx: Double, dy: Double): Path
SwiftUI Path.offsetBy(dx:dy:)
fun line(to: CGPoint): Path.Element
SwiftUI Path.Element.line(to:)
fun move(to: CGPoint): Path.Element
SwiftUI Path.Element.move(to:)
fun curve(to: CGPoint, control1: CGPoint, control2: CGPoint): Path.Element
SwiftUI Path.Element.curve(to:control1:control2:)
fun quadCurve(to: CGPoint, control: CGPoint): Path.Element
SwiftUI Path.Element.quadCurve(to:control:)

Types

class Path
SwiftUI Path
class Element
SwiftUI Path.Element