Instantly share code, notes, and snippets.

Embed
What would you like to do?
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