From the course: iOS 17 Development Essential Training
Unlock this course with a free trial
Join today to access over 24,600 courses taught by industry experts.
Creating data for a list
From the course: iOS 17 Development Essential Training
Creating data for a list
- [Instructor] In this chapter, we're going to go further with the mini weather app that we created previously in the course, and we're going to make an app that transitions between multiple views. In order to do that, we're going to create something called a data model. The data model will provide the data for our application, including days of the week with their accompanying high and low temperatures, an icon, and later even a color for the icon. So let's create our data model file by pressing command + N in Xcode, and then we're going to create a new Swift file under iOS. So from there, let's hit Next. We'll call this file Week, which will represent a week's worth of weather data, and then hit Return or Create. Create a few new lines at the bottom of this file. And then we're going to create a class called Week. So class, Week, capital W, and then some curly braces. This class is going to contain a list or array of…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.