func parseJSON(_ dosageData: Data) -> DoseModel? {
struct DoseModel: Identifiable {
}
I keep getting the type error on this code. Any suggestions
Code Block do { let json = try JSON(data: dosageData) let date = json["date"].stringValue let medicine = json["medicine"].stringValue let units = json["units"].doubleValue let value = json["value"].stringValue let dose = DoseModel(id: UUID(), --- Error Line ---- date: date, medicine: medicine, units: units, value: value) return dose } catch { delegate?.didFailWithError(error: error) return nil }
}struct DoseModel: Identifiable {
Code Block var id: ObjectIdentifier var date: String var medicine: String var units: String var value: String
}
I keep getting the type error on this code. Any suggestions