CGPoint

public extension CGPoint
  • Converts a CGPoint to an internal ScreenCoordinate type.

    Declaration

    Swift

    var screenCoordinate: ScreenCoordinate { get }
  • Interpolate a point along a fraction of a line between two points.

    Declaration

    Swift

    static func interpolate(origin: CGPoint, destination: CGPoint, fraction: CGFloat) -> CGPoint

    Parameters

    origin

    The starting point for the interpolation.

    destination

    The ending point for the interpolation.

    fraction

    A value between 0 and 1 that represents the fraction to interpolate to. A value of 0 represents the start position, and a value of 1 represents the end position.

    Return Value

    A CGPoint that represents the fractional point along the path between the source and destination points.