I have a networking method which returns 33 results. I save it in a CoreData database. Networking method starts every time an App launches (in ViewDidLoad). After every launch my CoreData database turns to be filled in with the same 33 results. So every launch I have 33, 66, 99, etc entries in it with the same names and attributes.
In my Entity Currency I have a unique attribute id like shortName (EUR, USD, etc).
How can I check what I have in CoreData after every Networking and if that shortName already exists just update its another attribute currentValue? And if there is no such shortName then fully create and save there.
The goal is to have only 33 entity's in my CoreData with recent information from Networking.
Thank you for a help in advance!