Functions

The following functions are available globally.

  • Creates a UIBezierPath representing an arrow. Often the arrow connects two circles, and you may wish to avoid overlapping with those shapes. So, this method actually starts drawing a specified distance away from from and ends the arrow a specified distance before reaching to, as illustrated below:

    +           ------------------->      +
    from                                  to
    

    The distance between from and the start of the arrow is fromRadius, and the distance between the end of the arrow and to is toRadius. If both are 0, the arrow extends the full distance between the two points.

    Requires: fromRadius, toRadius, arrowHeadLength, arrowHeadWidth all >= 0

    Declaration

    Swift

    public func pathForArrow(from: CGPoint,
                             to: CGPoint,
                             fromRadius: CGFloat = 0.0,
                             toRadius: CGFloat = 0.0,
                             arrowHeadLength : CGFloat = 6.0,
                             arrowHeadWidth : CGFloat = 6.0) -> UIBezierPath

    Parameters

    from

    where to start the arrow

    to

    where to end the arrow

    fromRadius

    the distance between from and the start of the arrow.

    toRadius

    the distance between the end of the arrow and to.

    arrowHeadLength

    How long the arrowhead is in points.

    arrowHeadWidth

    How wide the base of the arrowhead is in points.

    Return Value

    a path representing the arrow