Skip to content

Commit

Permalink
🆙 update README
Browse files Browse the repository at this point in the history
  • Loading branch information
takasek committed Feb 3, 2018
1 parent 6ea25ec commit 0131a7a
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

## Usage

ActionClosurable extends `UIControl`, `UIButton`, `UIGestureRecognizer` and `UIBarButtonItem`.
ActionClosurable extends `UIControl`, `UIButton`, `UIRefreshControl`, `UIGestureRecognizer` and `UIBarButtonItem`.
It helps writing swifty code with closure, instead of target and action like below:

```swift
Expand All @@ -23,6 +23,13 @@ button.onTap {
$0.enabled = false
}

// UIRefreshControl
tableView.refreshControl = UIRefreshControl { refreshControl in
DispatchQueue.main.asyncAfter(deadline: .now() + 5) {
refreshControl.endRefreshing()
}
}

// UIGestureRecognizer
label.addGestureRecognizer(UIPanGestureRecognizer { (gr) in
print("UIPanGestureRecognizer fire")
Expand All @@ -41,8 +48,6 @@ And you can extend any NSObject subclasses in very easy way. [Refer to the sourc

## Installation

### for Swift 3.0

ActionClosurable is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:

Expand All @@ -55,12 +60,6 @@ ActionClosurable is available through [Carthage](https://github.com/Carthage/Car
github "takasek/ActionClosurable"
```

### for Swift 2.3

take a look at the [`Swift-2.3` branch](https://github.com/takasek/ActionClosurable/tree/swift-2.3)



## Author

[takasek](https://twitter.com/takasek)
Expand Down

0 comments on commit 0131a7a

Please sign in to comment.