I got an empty UICollectionView, which means the cell count is 0 in it.
I intended to do so, so when no usable data, numberOfItemsInSection
will return 0. Then user can choose to Pull to refresh if no data available. (content size is smaller than screen height, excluding the PullToRefresh arrow views)
My problem is if there is at least one cell, pull to refresh works perfect,
but when no cell, I cannot pull to refresh. I am not sure how to do it, or if the cell count impact the pullToRefresh?
My code is quite simple:
[collectionView addPullToRefreshWithActionHandler:^{
[weakSelf reloadDashboardData];
}];
collectionView.alwaysBounceVertical = YES;
collectionView.bounces = YES;
[collectionView addSubview:_emptyIndicator];