Skip to content

Instantly share code, notes, and snippets.

@fitomad
Created September 2, 2018 09:44
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 fitomad/f90cdcaf4c7022b4ec9a31ea928a121a to your computer and use it in GitHub Desktop.
Save fitomad/f90cdcaf4c7022b4ec9a31ea928a121a to your computer and use it in GitHub Desktop.
BiciMADClient.shared.stations() { (result: BiciMADResult) -> Void in
switch result
{
case let .success(stations):
DispatchQueue.main.async
{
...
// Ocupacion
let low_count = stations.stationsCount(by: .low)
let middle_count = stations.stationsCount(by: .medium)
let high_count = stations.stationsCount(by: .high)
let unavailable_count = stations.stationsCount(by: .unavailable)
self.presentOccupation(lowLevel: low_count,
medium: middle_count,
high: high_count,
unavailable: unavailable_count)
...
}
case let .error(message):
print("Algo pasa con el servicio...")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment