Post

Replies

Boosts

Views

Activity

Reply to Swift Chart causing app to crash when deleting an item from the data array
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 } }
Jun ’24