I am working on a Map application. I have Points of Interest array, which I would have to display on the Map. When I display these points in a tableView, they have to be unique, but when I select one of them, I have to pass all the points so that they can be displayed on the map.
struct POI {
let id: String
let name: String
let floorName: String
}
For this struct, I am getting [POI] from the service, which has the same names and floorName for certain elements, but different ids. From the UI perspective, there is no point showing POI with the same name and floorName more than once. However, when the user selects one, I have to pass all the elements with the same name and floorName and different IDs, so that the map can show all of them.
Currently, I am using Dictionary grouping to find unique values, but was just wondering if there is any better way.