Flight Search
Use this method to provide real time flight search capabilities to your app.
let query = FlightQuery(number: "AC01", date: Date())
Traveler.flightSearch(query: query) { (flights, error) in
// ...
}
Alternatively you can use the delegate pattern
Traveler.flightSearch(query: query, delegate: self)
extension MyViewController: FlightSearchDelegate {
func flightSearchDidSucceedWith(_ result: [Flight]) {
}
func flightSearchDidFailWith(_ error: Error) {
}
}
FlightQuery query = new FlightQuery("AC01", new Date());
Traveler.flightSearch(query, new FlightSearchCallback() {
@Override
public void onFlightSearchSuccess(List<Flight> flights) {
}
@Override
public void onFlightSearchError(Error error) {
}
});