-
-
Save fitomad/f90cdcaf4c7022b4ec9a31ea928a121a to your computer and use it in GitHub Desktop.
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
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