In this article, we will introduce how to use ODRefreshControl to create a pull down to refresh ui view in iOS. ODRefreshControl is a “pull down to refresh” control for UIScrollView.
How to create?
(1) adding a refresh control to your table view
ODRefreshControl *refreshControl = [[ODRefreshControl alloc] initInScrollView:self.scrollView];
(2) adding event for ODRefreshControl
[refreshControl addTarget:self action:@selector(dropViewDidBeginRefreshing:) forControlEvents:UIControlEventValueChanged];
There are some customized properties of ODRefreshControl
They are:
@property (nonatomic, strong) UIColor *tintColor; @property (nonatomic, assign) UIActivityIndicatorViewStyle activityIndicatorViewStyle; @property (nonatomic, strong) UIColor *activityIndicatorViewColor; // iOS5 or more