I figured it out. I added Codable to the enum and cleaned the build folder and the error went away.
Post
Replies
Boosts
Views
Activity
No, I haven't. I'll check them out. I'm still learning swift programming and the crash logs are a little confusing to me. I did try my app in Xcode 16 and it doesn't crash on the iOS 18 simulator.
Here are the errors I'm getting
This is on the ConsumedDrink
This is in the ConsumedDrinkChartView
import Foundation
import SwiftData
@Model
class ConsumedDrink {
let id: UUID
var drink: Drink
var date: Date
@Transient var volumeMeasure: VolumeMeasurement {
let defaultVolume = DataStore.defaultVolume
let drinkVolume = self.drink.volume
let volume = drinkVolume.converted(to: defaultVolume.unit).value
return VolumeMeasurement(date: self.date, value: volume, unit: defaultVolume.unit.symbol)
}
init(drink: Drink, date: Date = Date()) {
self.id = UUID()
self.drink = drink
self.date = date
}
}
@DTS Engineer Thanks for the reply. Xcode 16.1 still has the dropdown to select the version. Do you think this is going to be removed in future releases of 16.1? It's convenient to have a dropdown instead of having to type the version. Typing in a version could be problematic.