Created
November 20, 2015 19:51
-
-
Save MMercieca/6880bb70ddb172318add to your computer and use it in GitHub Desktop.
Update Intervals first try
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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