Questions tagged [uirefreshcontrol]

A UIRefreshControl object provides a standard control that can be used to initiate the refreshing of a table view’s contents. You link a refresh control to a table through an associated table view controller object. The table view controller handles the work of adding the control to the table’s visual appearance and managing the display of that control in response to appropriate user gestures.

UIRefreshControl is a control available in iOS 6.0 () and later.

A UIRefreshControl object provides a standard control that can be used to initiate the refreshing of a table view’s contents. You link a refresh control to a table through an associated table view controller object. The table view controller handles the work of adding the control to the table’s visual appearance and managing the display of that control in response to appropriate user gestures.

In addition to assigning a refresh control to a table view controller’s refreshControl property, you must configure the target and action of the control itself. The control does not initiate the refresh operation directly. Instead, it sends the UIControlEventValueChanged event when a refresh operation should occur. You must assign an action method to this event and use it to perform whatever actions are needed.

The UITableViewController () object that owns a refresh control is also responsible for setting that control’s frame rectangle. Thus, you do not need to manage the size or position of a refresh control directly in your view hierarchy.

NOTE: Because the refresh control is specifically designed for use in a table view that's managed by a table view controller, using it in a different context can result in undefined behavior.

References:

493 questions
316
votes
19 answers

How to use pull to refresh in Swift?

I am building an RSS reader using swift and need to implement pull to reload functionality. Here is how i am trying to do it. class FirstViewController: UIViewController, UITableViewDelegate, UITableViewDataSource { @IBOutlet var refresh:…
xrage
  • 4,690
  • 4
  • 25
  • 31
308
votes
12 answers

UIRefreshControl without UITableViewController

Just curious, as it doesn't immediately seem possible, but is there a sneaky way to leverage the new iOS 6 UIRefreshControl class without using a UITableViewController subclass? I often use a UIViewController with a UITableView subview and conform…
Keller
  • 17,051
  • 8
  • 55
  • 72
150
votes
7 answers

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

I'm trying to add a UIRefreshControl to a UICollectionView, but the problem is that the refresh control does not appear unless the collection view fills up the height of its parent container. In other words, unless the collection view is long enough…
Merott
  • 7,189
  • 6
  • 40
  • 52
131
votes
15 answers

UIRefreshControl - beginRefreshing not working when UITableViewController is inside UINavigationController

I've setup a UIRefreshControl in my UITableViewController (which is inside a UINavigationController) and it works as expected (i.e. pull down fires the correct event). However, if I programmatically invoke the beginRefreshing instance method on the…
wows
  • 10,687
  • 7
  • 27
  • 27
83
votes
11 answers

Can I use a UIRefreshControl in a UIScrollView?

I have about 5 UIScrollView's already in my app which all load multiple .xib files. We now want to use a UIRefreshControl. They are built to be used with UITableViewControllers (per UIRefreshControl class reference). I do not want to re-do how…
SirRupertIII
  • 12,324
  • 20
  • 72
  • 121
56
votes
16 answers

Pull down to refresh data in SwiftUI

i have used simple listing of data using List. I would like to add pull down to refresh functionality but i am not sure which is the best possible approach. Pull down to refresh view will only be visible when user tries to pull down from the very…
PinkeshGjr
  • 8,460
  • 5
  • 41
  • 56
42
votes
3 answers

UIRefreshControl iOS 6 xcode

Does anyone have a short example of how to implement the new UIRefreshControl into xcode. I have a UITableViewController which displays Tweets, want to be able to pull down and refresh.
Gareth
  • 512
  • 1
  • 4
  • 15
37
votes
12 answers

Prefer Large Titles and RefreshControl not working well

I am using this tutorial to implement a pull-to-refresh behavior with the RefreshControl. I am using a Navigation Bar. When using normal titles everything works good. But, when using "Prefer big titles" it doesn't work correctly as you can see in…
Damia Fuentes
  • 5,308
  • 6
  • 33
  • 65
35
votes
13 answers

How do I "hide" a UIRefreshControl?

Occasionally my table view won't be connected to a service to refresh, and in that case, I don't want the UIRefreshControl to be present. After I add it in viewDidLoad, I've tried hiding it under certain circumstances with setEnabled: and setHidden:…
Doug Smith
  • 29,668
  • 57
  • 204
  • 388
34
votes
18 answers

UIRefreshControl Stuck After Switching Tabs in UITabBarController

I have a UITableViewController as the root view controller in a UINavigationController, which is in turn one of the view controllers in a UITabBarController. All hooked up in Storyboard. I've configured the UIRefreshControl for my table in…
Justin Ling
  • 690
  • 1
  • 8
  • 16
31
votes
2 answers

UIRefreshControl with UICollectionView in iOS7

In my application I use refresh control with collection view. UICollectionView *collectionView = [[UICollectionView alloc] initWithFrame:[UIScreen mainScreen].bounds]; collectionView.alwaysBounceVertical = YES; ... [self.view…
30
votes
4 answers

UIRefreshControl and UITableView's backgroundVIew

I have a UITableViewController on which I set a backgroundView. This controller has a UIRefreshControl installed. The problem is that when I set a background view, the refresh control is invisible. If I remove the background view, I can see the…
leftspin
  • 2,468
  • 1
  • 25
  • 40
30
votes
3 answers

How do I make the refresh action occur after the touch is released from the refresh control?

I am implementing UIRefreshControl on a UITableView to refresh the table's data. On other pull-to-refresh implementations, the refresh process does not begin until the user's finger is lifted while in the pull's refresh distance. UIRefreshControl…
outphase
  • 303
  • 1
  • 3
  • 4
30
votes
8 answers

UIRefreshControl at the bottom of the UITableView iOS6?

Is it possibile add UIRefreshControl at the bottom of the UITableView? I would use it to load more data. Please, Any suggest?
Dany
  • 2,290
  • 8
  • 35
  • 56
29
votes
8 answers

UIRefreshControl incorrect title offset during first run and sometimes title missing

The text is offset wrong by the first launch of UIRefreshControl... later sometimes the refresh text doesn't show up at all and just the spiny is visible I don't think i had this issue with iOS6... might be related to iOS7 Is in a…
Peter Lapisu
  • 19,915
  • 16
  • 123
  • 179
1
2 3
32 33