Right now, this is how you would get a time estimate based on cheapest product and pickup location:
let button = RideRequestButton()
let pickupLocation = CLLocation(latitude: 37.775159, longitude: -122.417907)
let builder = RideParametersBuilder().setPickupLocation(pickupLocation)
let ridesClient = RidesClient()
// get cheapest product id separately
ridesClient.fetchCheapestProduct(pickupLocation: pickupLocation, completion: {
product, response in
if let productID = product?.productID {
builder.setProductID(productID)
button.rideParameters = builder.build()
button.loadRideInformation()
}
})
I would love for this to be boiled down to:
let button = RideRequestButton()
let pickupLocation = CLLocation(latitude: 37.775159, longitude: -122.417907)
let builder = RideParametersBuilder().setPickupLocation(pickupLocation)
button.rideParameters = builder.build()
button.loadRideInformation() //cheapest product ID is used magic whoa
So we can fetch the cheapest product ID automatically when we call loadRideInformation() and there is a pickupLocation set. 😄 🎉
Right now, this is how you would get a time estimate based on cheapest product and pickup location:
I would love for this to be boiled down to:
So we can fetch the cheapest product ID automatically when we call
loadRideInformation()
and there is apickupLocation
set. 😄 🎉