From the course: Complete Guide to SwiftUI

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

Add and edit recipes

Add and edit recipes

- [Presenter] Okay, the last part of the code I'm going to do, and I'm going to scoot this over so you can see all the names here, is this add, update, and insert. Most of this code is dissimilar to what we've already done, but we have a few extra pieces here because of the way we deal with recipe steps. Again, we have a recipeID. This recipeID tells us what the recipe is, but we also have a bunch of steps for it, which will be in our bindable, and we also have displaySheet, which is saying if this sheet should work or not. This is going to be part of a sheet. We have two more variables I need to talk about, isAction. Again, that's going to flip back and forth between ingredients and action. And the last one here is addAnother, which we'll get to as we get further down the code. Bunch of temporary storage, which as I've talked about before, you have your private state variables that are your actual display values,…

Contents