Created
November 19, 2023 21:19
-
-
Save colinfwren/43210c3e850fc56399100a88eff24b9a to your computer and use it in GitHub Desktop.
Date Test Approach 1 fetchWeekData implementation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func fetchWeekData() { | |
do { | |
let descriptor = FetchDescriptor<ApproachModel>(predicate: #Predicate { todo in | |
todo.startDate >= startDate && todo.endDate <= endDate && todo.shownInWeek == true | |
}, sortBy: [SortDescriptor(\.endDate)]) | |
todos = try modelContext.fetch(descriptor) | |
} catch { | |
print("Failed to fetch week data") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment