Duplicate collectionView cells after reloadData with Firebase query
问题 I have a Firebase snapshot listener that checks for new documents, adds them to an array (the collectionView datasource) and then reloads the collectionView. However, I'm getting duplicate cells in the collectionView. I currently have 3 objects in my Firebase Firestore collection but they get duplicated for a total of 9 cells. I even added a check for the index so reloadData only happens after it reaches the end of the array. Here's the relevant code: messageListener = query