iOS 4.3 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];
or set "Refreshing" of UITableViewController
"Enabled" on storyboard.
[self.refreshControl addTarget:self
action:@selector(refresh)
forControlEvents:UIControlEventValueChanged];
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
.
The best way to Install ISRefreshControl is by using CocoaPods.
pod 'ISRefreshControl', '~> 1.4.1'
- install ISMethodSwizzling.
- add files under
ISRefreshControl/
to your project. - add
QuartzCore.framework
to "Link Binary With Libraries" (in "Build Phases").
see CHANGELOG.md.
Copyright (c) 2013 Yosuke Ishikawa
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.