I have a collection view which is loaded based on the API(Get method).The number of entries increases when new entry is added and it is reloaded with new entry at the end. How to reload the collection view with last showing first, second last as second and so on.
If you want to display array in reverse then you can do it like this:-
array.reversed()
OR
if you want to display last added item on top, then insert item at first index:-
yourArray.append(item)
let indexPath = IndexPath(row: 0, section: 0)
collectionView.insertItems(at: [indexPath])