rEquation
rEquation

Reputation: 77

UIRefreshControl does not stick after pulled in UICollectionView

I am using UIRefreshControl with a UICollectionView. The refreshing works but the view does not stay at the top after pulled (as it does with a uitableview). Is there a way to make this stick or is that only implemented for a UITableViewController?

self.refreshControl = [[UIRefreshControl alloc] init];
self.refreshControl.attributedTitle = [[NSAttributedString alloc] initWithString:@"Pull to Refresh"];
[self.refreshControl addTarget:self action:@selector(refresh:) forControlEvents:UIControlEventValueChanged];
[self.collectionView addSubview:self.refreshControl];
[self.collectionView setAlwaysBounceVertical:YES];

Upvotes: 4

Views: 500

Answers (1)

norlin
norlin

Reputation: 1275

For me it happens only when I'm trying to update cells before calling .endRefreshing().

So, to fix need first call .endRefreshing() and then update cells (reloadData and so on).

Upvotes: -1

Related Questions