startIndex
TypeScriptget startIndex(): numberSwift declarationvar startIndex: Int { get }The position of the first element in a nonempty collection. If the collection is empty, `startIndex` is equal to `endIndex`.
struct · iOS 14.0+ · SDK 27.1
struct PKStrokePathget startIndex(): numberSwift declarationvar startIndex: Int { get }The position of the first element in a nonempty collection. If the collection is empty, `startIndex` is equal to `endIndex`.
get creationDate(): globalThis.DateSwift declarationvar creationDate: Date { get }static initControlPointsCreationDateId(controlPoints: Array<PKStrokePoint>, creationDate: globalThis.Date, id: string): PKStrokePathSwift declarationinit<T>(controlPoints: T, creationDate: Date, id: UUID) where T : Sequence, T.Element == PKStrokePointCreates a stroke path with the specified cubic B-spline control points and a unique identifier. - Parameters: - controlPoints: An array of control points for a cubic B-spline. - creationDate: The start time of this path. - id: The unique identity of the path. > Warning: Using multiple stroke paths with identical IDs but different control points will result in undefined rendering behavior. Ensure each stroke path has a unique identifier.
static initControlPointsCreationDate(controlPoints: Array<PKStrokePoint>, creationDate: globalThis.Date): PKStrokePathSwift declarationinit<T>(controlPoints: T, creationDate: Date) where T : Sequence, T.Element == PKStrokePointCreates a stroke path with the specified cubic B-spline control points. - Parameters: - controlPoints: An array of control points for a cubic B-spline. - creationDate: The start time of this path.
parametricValue(parametricValue: number, step: PKStrokePath_InterpolatedSlice_Stride): numberSwift declarationfunc parametricValue(_ parametricValue: CGFloat, offsetBy step: PKStrokePath.InterpolatedSlice.Stride) -> CGFloatReturns the parametric value offset from the given value by the specified step. - parameter parametricValue: The floating point [0, count-1] parametric value. - parameter step: The distance to offset `parametricValue`. `step` can be positive or negative, distance or time. - returns: A parametric value offset by `step` from `parametricValue`.
interpolatedPoint(parametricValue: number): PKStrokePointSwift declarationfunc interpolatedPoint(at parametricValue: CGFloat) -> PKStrokePointReturns the on-curve stroke point for the specified parametric value.
interpolatedPoints(range: ("animatableData" | SDKHandle) | null, stride: PKStrokePath_InterpolatedSlice_Stride): PKStrokePath_InterpolatedSliceSwift declarationfunc interpolatedPoints(in range: ClosedRange<CGFloat>? = nil, by stride: PKStrokePath.InterpolatedSlice.Stride) -> PKStrokePath.InterpolatedSliceReturns an interpolated slice that strides across the specified range of the stroke path. - parameter range: The parametric range to create a slice in. - parameter stride: The stride to use between points - returns: A new slice that strides across this stroke path with `stride`.
get bezierRepresentation(): _CoreGraphics_CGPathSwift declarationvar bezierRepresentation: CGPath { get }A Bézier path representation of the path's curve, computed in linear time.
interpolatedLocation(parametricValue: number): { x: number; y: number }Swift declarationfunc interpolatedLocation(at parametricValue: CGFloat) -> CGPointReturns the on-curve location for the specified parametric value. The floating-point `parametricValue` must be in the range [0, count-1]. This has better performance than `interpolatedPoint(at: parametricValue).location` when only the location is required.
get id(): stringSwift declarationvar id: UUID { get }The unique identity of the stroke path. > Warning: Using multiple stroke paths with identical IDs but different control points will result in undefined rendering behavior. Ensure each stroke path has a unique identifier.
get endIndex(): numberSwift declarationvar endIndex: Int { get }The collection's "past the end" position---that is, the position one greater than the last valid subscript argument. When you need a range that includes the last element of a collection, use the half-open range operator (`..<`) with `endIndex`. The `..<` operator creates a range that doesn't include the upper bound, so it's always safe to use with `endIndex`. For example: let numbers = [10, 20, 30, 40, 50] if let index = numbers.firstIndex(of: 30) { print(numbers[index ..< numbers.endIndex]) } // Prints "[30, 40, 50]" If the collection is empty, `endIndex` is equal to `startIndex`.
static init(): PKStrokePathSwift declarationinit()subscript(index: number): PKStrokePointSwift declarationsubscript(index: PKStrokePath.Index) -> PKStrokePoint { get }Accesses the element at the specified position. The following example accesses an element of an array through its subscript to print its value: var streets = ["Adams", "Bryant", "Channing", "Douglas", "Evarts"] print(streets[1]) // Prints "Bryant" You can subscript a collection with any valid index other than the collection's end index. The end index refers to the position one past the last element of a collection, so it doesn't correspond with an element. - Parameter position: The position of the element to access. `position` must be a valid index of the collection that is not equal to the `endIndex` property. - Complexity: O(1)
subscript52479(range: "animatableData" | SDKHandle): PKStrokePathSwift declarationsubscript(range: ClosedRange<CGFloat>) -> PKStrokePath { get }Returns a copy of the path containing the control points in the specified parametric range. - Important: This subscript returns a new stroke path with points always starting at index zero. This differs from the `Range<Int>` subscript, which returns a `Slice` with points at their original index. - Parameter range: The parametric range to copy. Values must be within [0, count-1]. - Returns: A new stroke path containing the portion within the specified parametric range.
1 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.
PKStrokePath.init(bezierPath:creationDate:pointProvider:)
callback cannot propagate synchronous failure