UIRefreshControl Class Reference
| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Frameworks/UIKit.framework |
| Availability | Available in iOS 6.0 and later. |
| Declared in | UIRefreshControl.h |
Overview
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.
For information about basic view behaviors, see View Programming Guide for iOS.
Tasks
Initializing a Refresh Control
Accessing the Control Attributes
-
tintColorproperty -
attributedTitleproperty
Managing the Refresh Status
-
– beginRefreshing -
– endRefreshing -
refreshingproperty
Properties
attributedTitle
The styled title text to display in the refresh control.
Discussion
The default value of this property is nil.
Availability
- Available in iOS 6.0 and later.
Declared In
UIRefreshControl.hrefreshing
A Boolean value indicating whether a refresh operation has been triggered and is in progress. (read-only)
Availability
- Available in iOS 6.0 and later.
Declared In
UIRefreshControl.htintColor
The tint color for the refresh control.
Discussion
The default value of this property is nil.
Availability
- Available in iOS 6.0 and later.
Declared In
UIRefreshControl.hInstance Methods
beginRefreshing
Tells the control that a refresh operation was started programmatically.
Discussion
Call this method when an external event source triggers a programmatic refresh of your table. For example, if you use an NSTimer object to refresh the contents of the table view periodically, you would call this method as part of your timer handler. This method updates the state of the refresh control to reflect the in-progress refresh operation. When the refresh operation ends, be sure to call the endRefreshing method to return the control to its default state.
Availability
- Available in iOS 6.0 and later.
Declared In
UIRefreshControl.hendRefreshing
Tells the control that a refresh operation has ended.
Discussion
Call this method at the end of any refresh operation (whether it was initiated programmatically or by the user) to return the refresh control to its default state. If the refresh control is at least partially visible, calling this method also hides it. If animations are also enabled, the control is hidden using an animation.
Availability
- Available in iOS 6.0 and later.
Declared In
UIRefreshControl.hinit
Initializes and returns a standard refresh control.
Return Value
An initialized refresh control.
Discussion
The returned refresh control is configured with a default height and width. After you assign the control to a UITableViewController object, the frame of the control is adjusted to match and is managed thereafter.
Availability
- Available in iOS 6.0 and later.
Declared In
UIRefreshControl.h© 2012 Apple Inc. All Rights Reserved. (Last updated: 2012-09-19)