https://github.com/fitomad/emtclient
Client de acceso al servicio de tiempo de espera de EMT Madrid
https://github.com/fitomad/emtclient
emt emt-api madrid mobility swift
Last synced: 7 months ago
JSON representation
Client de acceso al servicio de tiempo de espera de EMT Madrid
- Host: GitHub
- URL: https://github.com/fitomad/emtclient
- Owner: fitomad
- License: mit
- Created: 2016-07-03T10:14:49.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-07-03T14:14:17.000Z (over 9 years ago)
- Last Synced: 2025-01-25T05:09:38.247Z (9 months ago)
- Topics: emt, emt-api, madrid, mobility, swift
- Language: Swift
- Size: 22.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# EMTClient
Client de acceso al servicio de tiempo de espera de EMT Madrid## Ejemplo
```swift
let busStopID: Int = 44EMTClient.sharedInstance.informacionParada(busStopID, completionHandler: { (information: BusInformationResult) -> Void in
switch information
{
case let BusInformationResult.Success(busStop):
dispatch_async(dispatch_get_main_queue())
{
// ... :)
}
// Luego nos servira para construir
// el adapter de la celda del mapa
self.selectedBusStop = busStop
case let BusInformationResult.Error(reason):
// ... :(
}EMTClient.sharedInstance.tiemposEsperaEnParada(busStopID, completionHandler:{ (information : BusInformationResult<[Arrival]>) in
switch information
{
case let BusInformationResult.Success(arrivals):
if !arrivals.isEmpty
{
for arrival: Arrival in arrivals
{
// ... :-)
}
case BusInformationResult.Error:
dispatch_async(dispatch_get_main_queue())
{
//... :-(
}
}
```
## Contacto¿Alguna sugerencia y/o pregunta? Contacta en Twitter con [@fitomad](https://twitter.com/fitomad)