Fairly new to IOS development. Working on a Recipe keeper app. I have a struct for recipe that holds things like the name, ingredients, instructions. Then I have a class RecipeStore with a published array of Recipes. I am trying to save an instance of RecipeStore in core data so the recipes are saved even when the app is force quit. I have never used Core data and I have done a lot of research but I just don't quite understand it. I tried using userdefaults but it seems that only works with like strings, ints, bools, etc???? Also struggling with some of the core data tutorials I tried following because some of my attributes are arrays. Also if there is a way for me to use userdefaults, please let me know because core data scares me! Any help would be appreciated. Thank you
struct Recipe : Codable, Identifiable {
var id: String
var name: String
var ingredients: [String]
var instructions: [String]
var category: String
var imageName: String
}
class RecipeStore : ObservableObject {
@Published var recipes: [Recipe]
init (recipes: [Recipe] = []) {
self.recipes = recipes
}
}


