From the course: iOS 14 Development Essential Training

Unlock the full course today

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

Creating data for a list

Creating data for a list

From the course: iOS 14 Development Essential Training

Start my 1-month free trial

Creating data for a list

- [Instructor] Now let's take a look at creating applications with multiple screens in them, and using a list view as is common in many iOS applications. To do that, we're going to start by creating a data model, that is a code object that can be used to store and provide data to our application. So to create that object press command + N on your keyboard. We want to create a new Swift file, so choose under iOS to Swift file under source, and then hit next and we'll call this data model. And then just hit return to create the file and the default location. So we have our code file. You'll notice that our canvas has gone away because we're not working in a Swift UI view. Let's also hide the navigator area to get some more space. Go down a few lines under import foundation and type struct and then you can use the code hinting by pressing return. And we'll call this table data. And then type a colon in the space and then type…

Contents