I don't know what you mean about the 'Numbers' file. To start, you should create a struct to store your plant's data and collectively, form an array of plants. Something like the following
struct Plant: Hashable, Identifiable {
let id = UUID()
var plantName = ""
var medicinalProperties: [MedProp]? = nil
var harvestInstructions = ""
var waterRequirement = ""
init?(plantName: String = "", medicinalProperties: [MedProp]? = nil, harvestInstructions: String = "", waterRequirement: String = "") {
self.plantName = plantName
if let medicinalProperties = medicinalProperties {
self.medicinalProperties = medicinalProperties
}
self.harvestInstructions = harvestInstructions
self.waterRequirement = waterRequirement
}
}
struct MedProp: Hashable, Identifiable {
let id = UUID()
...
}
There's a lot more to this than just the data models. If you want to learn SwiftUI, I suggest following Apple's excellent SwiftUI Landmarks tutorial. This will help you through the whole process while introducing you to SwiftUI.
Topic:
Developer Tools & Services
SubTopic:
Developer Forums
Tags: