From the course: iOS Development Tips

Unlock this course with a free trial

Join today to access over 22,400 courses taught by industry experts.

To-do lists in SwiftUI

To-do lists in SwiftUI

- [Instructor] In our last tip, I showed you how to make a single checkbox. Let's learn a bit about (mumbles) and Swift UI and build a checklist. If you download the exercise files, you'll find an expanded version of last week's project. Under the model folder, I added some data for a list of pizzas to try. You'll see that is has a struct backing it that stores the title and a default value of false for each item. Suppose I wanted to make a list of all my items. Head over to where it says CheckListView and I'm going to put in some more code here. Now what I do is I'd use a list, which we can start here by deleting this, list, and I'd put in my checklist data, and then inside the closure I'd have an item in, and then I'd use my check view. And I'll use is checked title like that. And I use my data set, so the struct has it is checked. And then in here I'll put item title. That makes sense. And then finally, right…

Contents