Reputation: 77
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
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