Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UICollectionView reloadSections with animation

Tags:

I'd like to reload UICollectionView with some interesting animation. In UITableView there's a method called reloadSections:withRowAnimation. But in UICollectionView there's just reloadSections.

How can I customize reloadSections animation? I definitely saw this in apps on the App Store.

like image 728
Sergey Avatar asked Oct 09 '13 13:10

Sergey


People also ask

How does UICollectionView work?

The collection view presents items onscreen using a cell, which is an instance of the UICollectionViewCell class that your data source configures and provides. In addition to its cells, a collection view can present data using other types of views.

What is swift UICollectionView?

From apple's documentation, UICollectionView is: An object that manages an ordered collection of data items and presents them using customizable layouts. The name and definition makes it clear, it is a way to display a Collection of UI Views in our app.


1 Answers

Just do it like that:

[self.collectionView performBatchUpdates:^{
    [self.collectionView reloadSections:[NSIndexSet indexSetWithIndex:0]];
} completion:nil];
like image 179
Fab1n Avatar answered Sep 21 '22 13:09

Fab1n