|
1 | | -# EasyPullToRefresh |
| 1 | +# EasyPullToRefresh :loudspeaker: |
2 | 2 |
|
3 | 3 | [](https://travis-ci.org/harshalrj25/EasyPullToRefresh) |
4 | 4 | [](https://cocoapods.org/pods/EasyPullToRefresh) |
5 | 5 | [](https://cocoapods.org/pods/EasyPullToRefresh) |
6 | 6 | [](https://cocoapods.org/pods/EasyPullToRefresh) |
7 | 7 |
|
8 | | -## Example |
| 8 | +Easily integrate pull to refresh without any hassle. Handle empty tableview with a single line. No need to add anything to storyboard or xib or code. |
9 | 9 |
|
10 | | -To run the example project, clone the repo, and run `pod install` from the Example directory first. |
| 10 | +## Example :books: |
11 | 11 |
|
12 | | -## Requirements |
| 12 | +To run the example project, clone the repo, and run `pod install` from the Example directory first. |
13 | 13 |
|
14 | | -## Installation |
| 14 | +## Installation :hourglass_flowing_sand: |
15 | 15 |
|
16 | 16 | EasyPullToRefresh is available through [CocoaPods](https://cocoapods.org). To install |
17 | 17 | it, simply add the following line to your Podfile: |
18 | 18 |
|
19 | 19 | ```ruby |
20 | 20 | pod 'EasyPullToRefresh' |
21 | 21 | ``` |
| 22 | + |
| 23 | + |
| 24 | +## Usage :bulb: |
| 25 | + |
| 26 | +After installation the pull to refresh will be available for every tableview inside your project. |
| 27 | +Use below call back to handle the refresh event. |
| 28 | + |
| 29 | + self.tableView.customRefresh { |
| 30 | + // You can do your API call here |
| 31 | + } |
| 32 | + |
| 33 | +Similarly if the tableview is empty, a message will be shown along with a reload button. |
| 34 | +Use below call back to handle reload event. |
| 35 | + |
| 36 | + self.tableView.customReload { |
| 37 | + // You can do your API call here |
| 38 | + } |
22 | 39 |
|
23 | | -## Author |
| 40 | +If you dont like the colors and theme, override all the controls according to your needs. |
| 41 | +You can override default colors and appearance for the UIRefreshControl, ReloadButton and DataEmptyLabel. |
| 42 | +Use Below variable names to access the controls |
| 43 | + |
| 44 | + // 1: Disable pull to refresh using the flag |
| 45 | + self.tableView.showPullToRefresh = false |
| 46 | + |
| 47 | + // 2: Disable empty tableview message and reload button |
| 48 | + self.tableView.showReloadOnEmpty = false |
| 49 | + |
| 50 | + // 3: Customize the UiRefreshControl |
| 51 | + self.tableView.customRefreshControl.backgroundColor = UIColor.green |
| 52 | + self.tableView.customRefreshControl.tintColor = UIColor.green |
| 53 | + |
| 54 | + // 4: Override custom message for empty tableview using below label |
| 55 | + self.tableView.customEmptyMessageLabel.text = "YOUR CUSTOM TEXT FOR EMPTY LIST" |
| 56 | + |
| 57 | + // 5: Customize the Reload button for empty tableview |
| 58 | + self.tableView.customReloadButton.backgroundColor = UIColor.green |
| 59 | + self.tableView.customReloadButton.layer.borderColor = UIColor.red.cgColor |
24 | 60 |
|
25 | | -harshalrj25, harshalrj25@gmail.com |
| 61 | + |
| 62 | +## Author :innocent: |
| 63 | + |
| 64 | +My email id, harshalrj25@gmail.com |
| 65 | + |
| 66 | +<table style="background-color:#F5F5DC"> |
| 67 | +<tr> |
| 68 | +<td> |
| 69 | +<img src="https://github.com/harshalrj25/MasterAssetsRepo/blob/master/myAvatar.jpg" width="180"/> |
| 70 | + |
| 71 | +Harshal Jadhav |
| 72 | + |
| 73 | +<p align="center"> |
| 74 | +<a href = "https://github.com/harshalrj25"><img src = "https://github.com/harshalrj25/MasterAssetsRepo/blob/master/gitHubLogo.png" width="32" height = "33"/></a> |
| 75 | +<a href = "https://stackoverflow.com/users/7882093/harshal-jadhav?tab=profile"><img src = "https://github.com/harshalrj25/MasterAssetsRepo/blob/master/stackoverflow svg icon.svg" width="36" height="36"/></a> |
| 76 | +<a href = "https://www.linkedin.com/in/harshal-jadhav-298ba416a/"><img src = "https://github.com/harshalrj25/MasterAssetsRepo/blob/master/linkedInLogo.svg" width="36" height="36"/></a> |
| 77 | +</p> |
| 78 | +</td> |
| 79 | +</tr> |
| 80 | +</table> |
26 | 81 |
|
27 | 82 | ## License |
28 | 83 |
|
29 | | -EasyPullToRefresh is available under the MIT license. See the LICENSE file for more info. |
| 84 | + |
| 85 | +It's all your's :gift: |
0 commit comments