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.
More...
Inheritance
-
NSObject -
UIResponder -
UIView -
UIControl -
UIRefreshControl
-
NSObject -
UIResponder -
UIView -
UIControl -
UIRefreshControl
Conforms To
Import Statement
import UIKit
@import UIKit;
Availability
Available in iOS 6.0 and later.
-
Initializes and returns a standard refresh control.
Declaration
Swift
init()Objective-C
- (instancetype)initReturn 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
UITableViewControllerobject, the frame of the control is adjusted to match and is managed thereafter.Import Statement
import UIKitAvailability
Available in iOS 6.0 and later.
-
The styled title text to display in the refresh control.
Declaration
Swift
var attributedTitle: NSAttributedString?Objective-C
@property(nonatomic, retain) NSAttributedString *attributedTitleDiscussion
The default value of this property is
nil.Import Statement
import UIKitAvailability
Available in iOS 6.0 and later.
-
Tells the control that a refresh operation was started programmatically.
Declaration
Swift
func beginRefreshing()Objective-C
- (void)beginRefreshingDiscussion
Call this method when an external event source triggers a programmatic refresh of your table. For example, if you use an
NSTimerobject 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 theendRefreshingmethod to return the control to its default state.Import Statement
import UIKitAvailability
Available in iOS 6.0 and later.
-
Tells the control that a refresh operation has ended.
Declaration
Swift
func endRefreshing()Objective-C
- (void)endRefreshingDiscussion
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.
Import Statement
import UIKitAvailability
Available in iOS 6.0 and later.
-
A Boolean value indicating whether a refresh operation has been triggered and is in progress. (read-only)
Declaration
Swift
var refreshing: Bool { get }Objective-C
@property(nonatomic, readonly, getter=isRefreshing) BOOL refreshingImport Statement
import UIKitAvailability
Available in iOS 6.0 and later.
Copyright © 2014 Apple Inc. All rights reserved. Terms of Use | Privacy Policy | Updated: 2013-12-16
