I want you to ask something about Core Data fetch process. I am using fetch method in the below from Core Data but I need something else. Let me explain to you. I 've tried to fetch all data and filter all of it in a dictionary but it didn't work and didn't make sense to me I have many data like
Date Price
01.08.2018 400
03.08.2018 600
04.08.2018 800
06.09.2018 1000
11.09.2018 300
19.09.2018 200
I want to fetch these data like:
Aug 2018 1800 September 2018 1500
How can i achieve of that?
Here is my fetch method
func fetchLessons() -> [Lessons] {
let context = persistentContainer.viewContext
let fetchRequest = NSFetchRequest<Lessons>(entityName: "Lessons")
do {
let lessons = try context.fetch(fetchRequest)
return lessons
} catch let fetchErr {
print("Failed to fetch students:", fetchErr)
return []
}
}