Functions
The following functions are available globally.
-
Download all NMBS’s railway stations from irail.be
Throws
An error when the download failsDeclaration
Swift
public func downloadStations(completionHandler: @escaping (Response<[RailwayStation]>)->Void )
Return Value
A list with all the NMBS Railway stations
-
Get suggestions for the best trips from one railway station to another
Suggestions come from: https://hello.irail.be/api/1-0/
Throws
When an error occurs while requesting the suggested tripsDeclaration
Swift
public func suggestionsForTrip(from start: RailwayStation, to end: RailwayStation) throws -> [Trip]
Parameters
start
The RailwayStation of the departure station
end
The RailwayStation of the arrival station
Return Value
an Array with suggested trips
-
Get suggestions for the best trips from one railway station to another
Suggestions come from: https://hello.irail.be/api/1-0/
Throws
When an error occurs while requesting the suggested tripsDeclaration
Swift
public func suggestionsForTrip(from start: RailwayStation.iRailID, to end: RailwayStation.iRailID) throws -> [Trip]
Parameters
start
The id of the departure station
end
The id of the arrival station
Return Value
an Array with suggested trips
-
Get suggestions for the best trips from one railway station to another.
Suggestions come from: iRail
Throws
When an error occurs while requesting the suggested tripsDeclaration
Swift
public func suggestionsForTrip(from start: String, to end: String) throws -> [Trip]
Parameters
start
The last path component of the id of the departure station
end
The last path component of the id of the arrival station
Return Value
an Array with suggested trips