A standard control that can initiate the refreshing of a scroll view’s contents.


class UIRefreshControl : UIControl


You can use a refresh control in a scroll view or an object that inherits from UIScrollView, such as UITableView or UICollectionView. You link a refresh control to a scroll view through an associated view controller object. The view controller handles the work of adding the control to the view’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 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 valueChanged 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 view controller 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.


Initializing a Refresh Control


Initializes and returns a standard refresh control.

Accessing the Control Attributes

var tintColor: UIColor!

The tint color for the refresh control.

var attributedTitle: NSAttributedString?

The styled title text to display in the refresh control.

Managing the Refresh Status

func beginRefreshing()

Tells the control that a refresh operation was started programmatically.

func endRefreshing()

Tells the control that a refresh operation has ended.

var isRefreshing: Bool

A Boolean value indicating whether a refresh operation has been triggered and is in progress.