NumbersLineShape

struct NumbersLineShape : Shape

A shape which draws the numbers in an array of integers as lines.

The area to draw is adjusted to the Rect in the parameter to the path function. Line lengths are adjusted to the range of numbers so that the largest (abs) value determines the length of the tallest line. Line width is also calculated based on the number of lines to draw adjusted to the available space.

  • Initializes the shape by providing the array which contains the numbers to be drawn.

    Declaration

    Swift

    init(sourceArray: [Int]?, activeInd1: Int, activeInd2: Int)

    Parameters

    sourceArray

    The array to draw.

  • Creates the Path shape from the numbers in the array

    Declaration

    Swift

    func path(in rect: CGRect) -> Path

    Parameters

    rect

    The rectangle to draw the lines.

    Return Value

    Returnst the path to draw to the View.