ios 怎么向CollectionView插入cell或者说item

How to insert new cells or items into UICollectionview ?
you first update your data source, and then you call the insert method. 
So if your data source is an array of 3 elements (e.g. A, B, C), and you add a new element D at position 0 you now have @[D, A, B, C]. You would then call 
[self.collectionView insertItemsAtIndexPaths:@[[NSInexPath indexPathForItem:0 inSection:0]]];.

你可能感兴趣的:(ios 怎么向CollectionView插入cell或者说item)