From the course: Complete Guide to SwiftUI
Unlock this course with a free trial
Join today to access over 24,600 courses taught by industry experts.
The model implementation
From the course: Complete Guide to SwiftUI
The model implementation
- [Instructor] We've got some models to play with, and I'll use this blank version to discuss the models you've got. And I'm going to start my review with Enums, but I'm first going to get this a little bigger so we can see things well. All right, and let's start over here in the folder that says Enumerations in the models. And in here you'll find IngredientCategory and UnitOfMeasure, let's start with UnitOfMeasure. And that just has, like many commercial kitchens, metric values for what we're going to be measuring. So we have dozen, gross, kilogram, gram, milliliter. So that's pretty simple. I've also defined the types of ingredients to categories for storage and the status of the ingredient, if it's prep or if it's a refrigerated item, for example. And you can see underneath there we've got two computed properties as well, one for unit of measure because we have a default unit of measure for some kinds of items, so that, for example, if we have a unit of measure that's liquid we're…
Contents
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
(Locked)
Introducing the capstone project2m 55s
-
(Locked)
The model schema2m 10s
-
(Locked)
Add model to project1m 47s
-
(Locked)
The model implementation5m 2s
-
A dual key model6m 12s
-
(Locked)
Styles4m 38s
-
(Locked)
Code custom controls4m 38s
-
(Locked)
Ingredients view4m 36s
-
(Locked)
Add navigation3m 31s
-
(Locked)
Recipe view5m 33s
-
(Locked)
Add and edit recipes5m 8s
-
(Locked)
Testing6m 54s
-
(Locked)
-