The reason why SmartRefresh , an open source library on Android, is so popular, I personally think it is because SmartRefresh gathers various high-quality refresh styles in one, and the switching of styles is very simple, and there is no need to consider the compatibility and stability after changing styles. Before it appeared, there were also various excellent styles of refresh on github, but the cost of switching was relatively high and the risk was also high; at the same time, he could integrate various styles of styles in one framework, which also showed that it was very scalable, even if it could not be found. It is suitable for your own style, or you can solve it by customizing the style.

So now I have good news, the IOS version of SmartRefreshControl is finally released!

github: project address
gitee: project address (fast domestic speed)

Introduction

SmartRefreshControl is the IOS version of SmartRefreshLayout . It retains the same design as the Android version in 理念 and 外观 , but due to the differences between the Android and IOS systems, the IOS version has the same function and features. It is different from the Android version. The refresh control is written in ObjectiveC, and the demo DemoApp is written in Swift.

At present SmartRefreshControl the function is not very powerful or stable, but the functions of the Android version are implemented at the interface level. Everyone is welcome to experience and discover bugs. It is not recommended for use in official projects.

origin

After graduating from college, I worked on Android development most of the time. After the fire of Android version SmartRefresh , I began to transition to IOS development. I have three years of IOS development experience. Since there is no refresh library with the same open source library as SmartRefresh on IOS, I also want to consolidate the IOS skills I have learned. In my spare time, I copied Android SmartRefresh to IOS platform. After more than a year of hard work, it was finally completed.

Show results

Delivery Material
header-delivery.gifheader-material.gif
Refresh-your-deliveryMaterialHeader
BezierRadar BezierCircle
header-radar.gifheader-circle.gif
Pull To Refresh Pull Down To Refresh
FlyRefresh DropBox
header-fly.gifheader-drop.gif
FlyRefresh DropBoxHeader
Phoenix Taurus
header-phoenix.gifheader-taurus.gif
Yalantis/Phoenix Yalantis/Taurus
BattleCity HitBlock
header-game-tank.gifheader-game-block.gif
FunGame/BattleCity FunGame/HitBlock
StoreHouse WaveSwipe
header-store.gifheader-wave.gif
CRefreshLayout WaveSwipeRefreshLayout
Original Classics
header-original.gifheader-classics.gif
FlyRefresh ClassicsHeader

If you need to experience the various refresh headers listed above, you need to clone the git source code, compile and run the Demo project with Xcode.

Simple use case

1. Add dependencies in Podfile

 pod 'SmartRefreshControl', '~> 0.1.0'

2. Add refresh control in ViewController

 #import <SmartRefreshControl/SmartRefreshControl.h>

@interface DemoTableViewController ()

@property (strong, nonatomic) IBOutlet UITableView *tableView;  
@property (strong, nonatomic) UIRefreshBezierRadarHeader *header;  

@end

@implementation DemoTableViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    //方式1: 初始化同时绑定事件
    [self setHeader:[UIRefreshBezierRadarHeader attach:self.tableView target:self action:@selector(onRefresh)]];

    //方式2: 先初始化,再绑定事件
    [self setHeader:[UIRefreshBezierRadarHeader attach:self.tableView]];
    [self.header addTarget:self action:@selector(onRefresh)];

    //方式3: 先创建,再绑定
    [self setHeader:[UIRefreshBezierRadarHeader new]];
    [self.header attach:self.tableView];
    [self.header addTarget:self action:@selector(onRefresh)];

}

@end

3. Add refresh listener event

 @implementation DemoTableViewController

- (void)onRefresh {
    [self.header finishRefresh]; //关闭刷新,可以改成请求网络,成功/失败之后再关闭刷新
}

@end

scwang90
346 声望88 粉丝