init(name:estimatedPickupDate:)
Initializes and returns a ride option object with the specified name and pickup information.
Declaration
init(name: String, estimatedPickupDate: Date)Parameters
- name:
The name of the ride option as a user-readable string. The system displays this string to the user during the ride selection process and when confirming the ride. Use this string to provide a unique description of the ride being offered.
- estimatedPickupDate:
The estimated time of arrival for the ride at the user’s location. This information is presented to the user during the ride selection process.
Return Value
An initialized ride option object or nil if the object could not be initialized.
Discussion
After initializing the object, fill in the other properties of the newly created object before adding it to your response object.