Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
BiciMADClient.shared.stations() { (result: BiciMADResult) -> Void in
switch result
case let .success(stations):
// 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
You can’t perform that action at this time.