<commit_before># Customizable PullToRefresh

This component implements pure pull-to-refresh logic and you can use it for developing your own pull-to-refresh animations, [like this one.](https://github.com/Yalantis/PullToMakeSoup)

## Swift 2.0
Currently we maintain a [branch](https://github.com/Yalantis/PullToRefresh/tree/swift_2.0) to provide support for Swift 2.0.

##Requirements
- iOS 8.0+
- Xcode 6.3
- Swift 1.2

##Installing with [CocoaPods](https://cocoapods.org)

```ruby
use_frameworks!
pod 'PullToRefresher', '~> 1.0'
```

##Usage

At first, import PullToRefresh:

```swift
import PullToRefresh
```

The easiest way to create *PullToRefresh*:

```swift
let refresher = PullToRefresh()
```

It will create a default pull-to-refresh with a simple view which has single *UIActivitiIndicatorView*. To add refresher to your *UIScrollView* subclass:

```swift
tableView.addPullToRefresh(refresher, action: {
    // action to be performed (pull data from some source)
})
```

After the action is completed and you want to hide the refresher:

```swift
tableView.endRefresing()
```

You can also start refreshing programmatically:

```swift
tableView.startRefreshing()
```

But you probably won’t use this component, though. *UITableViewController* and *UICollectionViewController* already have a simple type of refresher.
It’s much more interesting to develop your own pull-to-refresh control.

##Creating custom PullToRefresh

To create a custom refresher you would need to initialize *PullToRefresh* class with two objects:

- **refreshView** is a UIView object which will added to your scroll view;
- **animator** is an object which will animate elements on refreshView depending on the state of PullToRefresh.

```swift
let awesomeRefrehser = PullToRefresh(refresherView: yourView, animator: yourAnimator)
```
###Steps for creating custom PullToRefresh

1) Create a custom *UIView* with *.xib and add all images that you want to animate as subviews. Pin them with outlets:

```swift
class RefreshView: UIView {
    @IBOutlet<commit_msg>Update README.md, fix a little typo<commit_after># Customizable PullToRefresh

This component implements pure pull-to-refresh logic and you can use it for developing your own pull-to-refresh animations, [like this one.](https://github.com/Yalantis/PullToMakeSoup)

## Swift 2.0
Currently we maintain a [branch](https://github.com/Yalantis/PullToRefresh/tree/swift_2.0) to provide support for Swift 2.0.

##Requirements
- iOS 8.0+
- Xcode 6.3
- Swift 1.2

##Installing with [CocoaPods](https://cocoapods.org)

```ruby
use_frameworks!
pod 'PullToRefresher', '~> 1.0'
```

##Usage

At first, import PullToRefresh:

```swift
import PullToRefresh
```

The easiest way to create *PullToRefresh*:

```swift
let refresher = PullToRefresh()
```

It will create a default pull-to-refresh with a simple view which has single *UIActivitiIndicatorView*. To add refresher to your *UIScrollView* subclass:

```swift
tableView.addPullToRefresh(refresher, action: {
    // action to be performed (pull data from some source)
})
```

After the action is completed and you want to hide the refresher:

```swift
tableView.endRefreshing()
```

You can also start refreshing programmatically:

```swift
tableView.startRefreshing()
```

But you probably won’t use this component, though. *UITableViewController* and *UICollectionViewController* already have a simple type of refresher.
It’s much more interesting to develop your own pull-to-refresh control.

##Creating custom PullToRefresh

To create a custom refresher you would need to initialize *PullToRefresh* class with two objects:

- **refreshView** is a UIView object which will added to your scroll view;
- **animator** is an object which will animate elements on refreshView depending on the state of PullToRefresh.

```swift
let awesomeRefrehser = PullToRefresh(refresherView: yourView, animator: yourAnimator)
```
###Steps for creating custom PullToRefresh

1) Create a custom *UIView* with *.xib and add all images that you want to animate as subviews. Pin them with outlets:

```swift
class RefreshView: UIView {
    @IBOutlet
{'fraction_non_alphanumeric': 0.09574726609963548, 'fraction_numerical': 0.007290400972053463, 'mean_word_length': 5.061855670103093, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6550679', 'n_tokens_mistral': 1311, 'n_tokens_neox': 1206, 'n_words': 478}