@@ -50,8 +50,7 @@ pod "PullToRefreshKit"
5050 }
5151```
5252
53- <img src="https://raw.github.com/LeoMobileDeveloper/PullToRefreshKit/master/
54- Screenshot/gif2.gif" width="320">
53+ <img src =" https://raw.github.com/LeoMobileDeveloper/PullToRefreshKit/master/Screenshot/gif2.gif " width =" 320 " >
5554
5655
5756###左拉退出当前界面
@@ -75,6 +74,26 @@ Screenshot/gif2.gif" width="320">
7574
7675<img src =" https://raw.github.com/LeoMobileDeveloper/PullToRefreshKit/master/Screenshot/gif4.gif " width =" 200 " >
7776
77+ ###配置默认的属性
78+ PullToRefershKit提供操作符` SetUp ` 来实现配置,例如,配置默认header
79+
80+ ```
81+ self.tableView.setUpHeaderRefresh { [weak self] in
82+ delay(1.5, closure: {
83+ self?.tableView.endHeaderRefreshing(.Success)
84+ })
85+ }.SetUp { (header) in
86+ header.setText("Pull to refresh", mode: .pullToRefresh)
87+ header.setText("Release to refresh", mode: .releaseToRefresh)
88+ header.setText("Success", mode: .refreshSuccess)
89+ header.setText("Refreshing...", mode: .refreshing)
90+ header.setText("Failed", mode: .refreshFailure)
91+ header.setText("Error", mode: .refreshError)
92+ header.textLabel.textColor = UIColor.orangeColor()
93+ header.imageView.image = nil
94+ }
95+ ```
96+
7897###自定义下刷新界面
7998对于自定义界面,你唯一要做的就是写一个UIView的子类,然后实现以下协议中的一个
8099
@@ -86,6 +105,24 @@ Screenshot/gif2.gif" width="320">
86105
87106你只需要根据协议提供的回调来更新时图的状态
88107
108+ 这个协议提供的方法如下
109+
110+ ```
111+ //触发刷新的距离,也是header的高度
112+ func distanceToRefresh()->CGFloat
113+ //已经开始刷新的回调
114+ func didBeginRefreshing()
115+ //拖拽过程中,拖拽百分比的回调
116+ func percentageChangedDuringDragging(percent:CGFloat)
117+ //将要开始刷新
118+ func willBeginRefreshing()
119+ //将要结束刷新,result是刷新的结果,对应着界面header将要隐藏
120+ func willEndRefreshing(result:RefreshResult)
121+ //已经结束刷新,result是刷新的结果,对应着界面header完全隐藏
122+ func didEndRefreshing(result:RefreshResult)
123+ ```
124+
125+
89126## Author
90127
91128Leo, leomobiledeveloper@gmail.com
0 commit comments