From the course: Swift: Delegations and Data Sources

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Delegates and data sources in Apple methods

Delegates and data sources in Apple methods

From the course: Swift: Delegations and Data Sources

Start my 1-month free trial

Delegates and data sources in Apple methods

- I've shown you the workings of a data source. The prime place you'll see data sources is for user interface controls, many already in the APIs. Knowing how they work will give you insight into using them. Let's look at an example of this in the Huli Pizza order app. Head over to the app, and go to the storyboard. If you zoom out the storyboard a little bit, you'll see towards the bottom, there's one that's for beverages, and I'll zoom in on that. You'll see this beverage scene uses a picker. Pickers are one of many controls that use data sources as delegates. This picker is not yet implemented. So we'll add data sources to implement it. So go to the BeverageViewController. I've already implemented the delegate for you. But go ahead and implement the data source. So at the end of UIPickerViewDelegate, you'll put UI... PickerViewDataSource. Once again, we get that little error, that says we do not conform to protocol. I'm going to go ahead and create the stubs. I'm again going to cut…

Contents