help me! (coredata)

I am studying using core data. Especially the fetchrequest is difficult.

Can't i save the last 7 values ​​of a specific attribute of coredata in an array?

The goal is to use the charts package. I want to call 7 attribute values ​​and express them in a chart.

Can't i save the last 7 values ​​of a specific attribute of coredata in an array?

It seems that is a similar question as one of your previous posts.

Define an array of values of the specific attribute var storedData : [MySpecificAttribute] = []

each time you update in Core Data, append the new value to the array.

If you have more than 7 items, remove items from the start till you have 7 items left.

help me! (coredata)
 
 
Q