Post

Replies

Boosts

Views

Activity

Reply to SwiftData Model didset
I also like to validate inside the model. But I'm not sure what is the best way to do this. Is this good practice? @Model public final class importConfig: Identifiable, ObservableObject{ ... private var _selectedSheetID: UUID? var selectedSheetID: UUID? { get { return __selectedSheetID } set { // validation selectedSheetID = newValue } } }
Nov ’23