Path
public class Path : Shape
extension Path: CGDrawable
extension Path: SVGDrawable
extension Path: Hashable
Represents a multi-point path
-
A Rectangle that contains the receiver
Declaration
Swift
public var boundingBox: Rectangle { get } -
Points that make up the path
Declaration
Swift
public var points: [Vector] -
Whether to close the path
This is done by appending the first point to the end of
pointswhile drawingDeclaration
Swift
public var close: Bool -
Instantiate a new Path from an array of Vectors
Declaration
Swift
public init(points: [Vector] = [])Parameters
pointsPoints in the path
-
Instantiate a new Path from an array of Vectors
Declaration
Swift
public convenience init(point: Vector)Parameters
pointsPoints in the path
-
Instantiate a new Path from a Bézier curve
Declaration
Swift
public convenience init(_ bezier: BezierPath)Parameters
bezierThe curve it convert to sharp lines
-
Append a point to the path
Declaration
Swift
public func addPoint(_ point: Vector)Parameters
pointNew Vector
-
Append an array of points to the path
Declaration
Swift
public func addPoints(_ points: [Vector])Parameters
pointNew Vectors
-
Append the points of another Path
Declaration
Swift
public func addPoints(_ other: Path)Parameters
otherThe other Path
-
Create a smooth Bézier curve
Declaration
Swift
@available(*, deprecated, message: "Use BezierPath(_:smoothing:﹚ instead.") public func smoothLine() -> BezierPath -
Draw the receiver in the specified context
Declaration
Swift
public func draw(in context: CGContext)Parameters
contextContext in which to draw
-
Draw a representation of the receiver meant for debugging the shape in the specified context
Declaration
Swift
public func debugDraw(in context: CGContext)Parameters
contextContext in which to draw
-
Create an
XMLElementfor the Path in its drawing styleDeclaration
Swift
public func svgElement() -> XMLElement -
Returns a Boolean value indicating whether two values are equal.
Equality is the inverse of inequality. For any values a and b, a == b implies that a != b is false.
Declaration
Swift
public static func == (lhs: Path, rhs: Path) -> Bool -
Declaration
Swift
public func hash(into hasher: inout Hasher)
View on GitHub
Path Class Reference