iOS5 or later
- add files under
ISRefreshControl/
to your project. - import
ISRefreshControl.h
.
Usage of ISRefreshControl
is almost the same as that of UIRefreshControl
.
set refreshControl
of UITableViewController
in viewDidLoad
.
self.refreshControl = (id)[[ISRefreshControl alloc] init];
[self.refreshControl addTarget:self
action:@selector(refresh)
forControlEvents:UIControlEventValueChanged];
or just call addSubview:
UIScrollView *scrollView = [[UIScrollView alloc] init];
ISRefreshControl *refreshControl = [[ISRefreshControl alloc] init];
[scrollView addSubview:refreshControl];
[refreshControl addTarget:self
action:@selector(refresh)
forControlEvents:UIControlEventValueChanged];
NOTE: currently, ISRefreshControl
does not support setting on storyboard.
works as real UIRefreshControl
.
the constructor of ISRefreshControl
returns an instance of UIRefreshControl
.
imitates UIRefreshControl
.
ISRefreshControl
sends UIControlEventValueChanged
when content offset of UITableView
overs threshold.
UITableViewController
is extended to send content offset to ISRefreshControl
.
MIT