Functions

The following functions are available globally.

  • 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 trips

    Declaration

    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 trips

    Declaration

    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 trips

    Declaration

    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