How do i prevent duplicates in RealmSwift List?
How do I prevent adding duplicates to a list in RealmSwift ? I have my User as a realm object, but the real data source is a server (simply caching the user locally with Realm). When I get the current user data from my server, i want to make sure that my user stored in realm has all the playlists coming from the server (and that their in sync wrt list of tracks and etc.). I'm worried that if i loop over those lists from the server, appending to myUser.playlists , that I may end up adding the same playlist to the user's list of playlists multiple times. class User: Object { dynamic var name = "