Tag Archives: UI

UIRefreshControl bug in landscape mode.

The iOS UIRefreshControl¬†provides a standard “pull-down-to-refresh” mechanism for certain UIScrollView classes such as UITableView and UICollectionView.

The UIRefreshControl, however, has a bug in landscape mode on the iPhone whereby there isn’t enough room to pull down to trigger the refresh mechanism. Go here for more information on the bug and possible workarounds.

I ended up using the following code in my UIScrollViewDelegate implementation (both UITableViewDelegate and UICollectionViewDelegate conform to UIScrollViewDelegate):

- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate
{
    if (self.collectionView.contentOffset.y < -80 && ![self.pullDownRefreshControl isRefreshing])
    {
        [self.pullDownRefreshControl beginRefreshing];
        // perform refresh operation...
    }
}

The¬†“pull-down-to-refresh” animation isn’t as slick, but it’s a good workaround for now.

Advertisements