ChartBGView

class ChartBGView : UIView

This class is a subclass of UIView used to create the three bands of the ‘safe’ range for the background of the chart using it’s methods.

  • The draw method is called on the instantiation of the ChartBGView. It calls methods to create the 3 bands that show the ‘safe’ range of blood glucose measurements.

    • Paramater rect: CGRect, the bounds of the View.

    Declaration

    Swift

    override func draw(_ rect: CGRect)
  • Creates a rectangle of colour White from the mid-point of the CustomView (~10 on graph to ~4) to create the ‘safe’ region.

    Declaration

    Swift

    private func drawMiddleBand()
  • Creates a rectangle with a size of the top half of the CustomView giving the top band (between 10 and 20 on the graph).

    Declaration

    Swift

    private func drawTopBand()