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
}
}
}
Post
Replies
Boosts
Views
Activity
Thx, done, send feedback.