Skip to content

Instantly share code, notes, and snippets.

@colinfwren
Created November 19, 2023 21:26
Show Gist options
  • Save colinfwren/3ad4c5b038eaead12ebba76b1ebb19a2 to your computer and use it in GitHub Desktop.
Save colinfwren/3ad4c5b038eaead12ebba76b1ebb19a2 to your computer and use it in GitHub Desktop.
Date Test Approach 2 fetchDayData
func fetchDayData() {
do {
let descriptor = FetchDescriptor<ApproachModel>(predicate: #Predicate { todo in
todo.year == year && todo.month == month && todo.day == day && todo.shownInDay == true
})
todos = try modelContext.fetch(descriptor)
} catch {
print("Failed to fetch day data")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment