Skip to content

Instantly share code, notes, and snippets.

@MMercieca
Created November 20, 2015 19:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MMercieca/6880bb70ddb172318add to your computer and use it in GitHub Desktop.
Save MMercieca/6880bb70ddb172318add to your computer and use it in GitHub Desktop.
Update Intervals first try
func updateIntervals() {
if (intervals.count == 0) {
return;
}
let currentInterval = intervals.first!
if currentIntervalProgress == 0.0 {
currentColor = currentInterval.color()
speedLabel.text = currentInterval.description()
alertSpeed(currentInterval)
currentIntervalProgress += updateInterval
} else if currentIntervalProgress >= currentInterval.runFor() {
currentIntervalProgress = 0.0 intervals.removeAtIndex(0)
} else {
currentIntervalProgress += updateInterval
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment