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) {
    
    }
}

Last updated