iOS拉动刷新实现:Pull-to-Refresh.Rentals-iOS
y37f
10年前
这个项目的目标是提供一个简单和可定制的拉动刷新实现。
使用
For a working implementation, Have a look at the Sample Project - sample
- Add folder YALSunnyRefreshControll to your project.
- Implement header and setup YALSunnyRefreshControl as a property.
- Init and associate YALSunnyRefreshControl with your UITableView or UICollectionView.
- Add images from Images.xcassets folder in Sample Project.
#import "YALSunnyRefreshControl.h" @property (nonatomic,strong) YALSunnyRefreshControl *sunnyRefreshControl; - (void)viewDidLoad { [super viewDidLoad]; [self setupRefreshControl]; } -(void)setupRefreshControl{ self.sunnyRefreshControl = [YALSunnyRefreshControl attachToScrollView:self.tableView target:self refreshAction:@selector(sunnyControlDidStartAnimation)]; } -(void)sunnyControlDidStartAnimation{ // start loading something } -(IBAction)endAnimationHandle{ [self.sunnyRefreshControl endRefreshing]; }