Skip to content

Instantly share code, notes, and snippets.

@Pasanpr
Created January 18, 2017 16:40
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 Pasanpr/486a761164b8795433231ed20e992b7a to your computer and use it in GitHub Desktop.
Save Pasanpr/486a761164b8795433231ed20e992b7a to your computer and use it in GitHub Desktop.
class RaceManager: HorseRaceDelegate {
let race: Race
init(race: Race) {
self.race = race
race.delegate = self
race.start()
}
func race(_ race: Race, didStartAt time: Date) {
// some implementation
}
func addLapLeader(_ horse: Horse, forLap lap: Int, atTime time: Date) {
// some implementation
}
func race(_ race: Race, didEndAt time: Date, withWinner winner: Horse) {
// some implementation
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment