-
Notifications
You must be signed in to change notification settings - Fork 343
Glucose Chart
GlucoseChartManager.swift
The chart stores glucose points in glucoseChartPoints
While user is panning backward, the glucoseChartPoints array will get bigger and bigger, which will slow down the panning. To avoid that, a clean up of the array if a maximum number of elements is stored. This maximum is defined in the constant maximumElementsInGlucoseChartPointsArray:Int When this amount is reached, the array is renewed (ie emptied) and rebuilt with new glucoseChartPoints, depending on where in time the user is currently looking at
This variable is set by testing on an old iPhone SE, seeing when the panning is getting slowed down.
If the app receives a memory warning, then also a clean up is done In case of memory warning, longer list of variables is set to nil
When the app goes to the background, then also all data in the chartManager is set to nil