UIRefreshControl with UICollectionView in iOS7

Having the same problem and found a workaround that seems to fix it. This seems to be happening because the UIScrollView is slowing down the tracking of the pan gesture when you pull past the edge of the scrollview. However, UIScrollView is not accounting for changes to contentInset during tracking. UIRefreshControl changes contentInset when it … Read more

UIRefreshControl on UICollectionView only works if the collection fills the height of the container

Try this: self.collectionView.alwaysBounceVertical = YES; Complete code for a UIRefreshControl UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init]; refreshControl.tintColor = [UIColor grayColor]; [refreshControl addTarget:self action:@selector(refershControlAction) forControlEvents:UIControlEventValueChanged]; [self.collectionView addSubview:refreshControl]; self.collectionView.alwaysBounceVertical = YES;

UIRefreshControl – beginRefreshing not working when UITableViewController is inside UINavigationController

It seems that if you start refreshing programmatically, you have to scroll the table view yourself, say, by changing contentoffset [self.tableView setContentOffset:CGPointMake(0, -self.refreshControl.frame.size.height) animated:YES]; I would guess the reason for this is that it could be undesirable to scroll to the refresh control when user is in the middle/bottom of the table view? Swift 2.2 … Read more

How to use pull to refresh in Swift?

Pull to refresh is built in iOS. You could do this in swift like let refreshControl = UIRefreshControl() override func viewDidLoad() { super.viewDidLoad() refreshControl.attributedTitle = NSAttributedString(string: “Pull to refresh”) refreshControl.addTarget(self, action: #selector(self.refresh(_:)), for: .valueChanged) tableView.addSubview(refreshControl) // not required when using UITableViewController } @objc func refresh(_ sender: AnyObject) { // Code to refresh table view } … Read more

UIRefreshControl without UITableViewController

On a hunch, and based on DrummerB’s inspiration, I tried simply adding a UIRefreshControl instance as a subview to my UITableView. And it magically just works! UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init]; [refreshControl addTarget:self action:@selector(handleRefresh:) forControlEvents:UIControlEventValueChanged]; [self.myTableView addSubview:refreshControl]; This adds a UIRefreshControl above your table view and works as expected without having to use a … Read more