CGPoint

extension CGPoint
  • Returns the distance between two points.

    Declaration

    Swift

    public func distance(to point: CGPoint) -> CGFloat

    Parameters

    point

    The point to which to calculate the distance.

    Return Value

    The distance between self and another point.