Skip to content

Commit 40ee4dd

Browse files
committed
Updated README.
1 parent 977a1f7 commit 40ee4dd

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,23 @@ The view or layer that you use it on is divided into small triangles, which then
3131
Disintegrate adds a single method to both UIView and CALayer classes.
3232
```swift
3333
func disintegrate(direction: DisintegrationDirection = DisintegrationDirection.random(),
34-
estimatedTrianglesCount: Int = 66)
34+
estimatedTrianglesCount: Int = 66,
35+
completion: (() -> ())? = nil)
3536
```
3637
The animation can be customized by two parameters:
3738
* `direction` - direction in which the triangle particles will move. By default, the direction is chosen randomly from the set of 8 available options: up, down, left, right, upper left, upper right, lower left and lower right.
3839
* `estimatedTrianglesCount` - estimated number of triangle particles. Specifying it allows you to adjust the performance of the animation to your needs. For example, if you know that you want to use it on a smaller view, you can divide it into more triangles. Keep in mind, that it is only an estimate, and the final count of the triangles will also depend on the exact size of the view or the layer. This parameter does have an empirically chosen default value, so you don't have to specify it.
3940

41+
Additionally, you can specify a completion block that will be executed when the animation finishes.
42+
4043
Here are some examples of using Disintegrate:
4144
```swift
4245
avatarImageView.disintegrate()
4346
cancelButton.disintegrate(direction: .upperLeft)
4447
gradientLayer.disintegrate(estimatedTrianglesCount: 100)
45-
errorLabel.disintegrate(direction: .down, estimatedTrianglesCount: 200)
48+
errorLabel.disintegrate(direction: .down, estimatedTrianglesCount: 200) {
49+
print("Error label animation finished.")
50+
}
4651
```
4752

4853
## Installation
@@ -60,7 +65,7 @@ pod 'Disintegrate'
6065

6166
To integrate Disintegrate into your Xcode project using Carthage, specify it in your Cartfile:
6267
```ruby
63-
github "dbukowski/Disintegrate" ~> 0.1.0
68+
github "dbukowski/Disintegrate" ~> 0.2.0
6469
```
6570
Run carthage update to build the framework and drag the built Disintegrate.framework into your Xcode project.
6671

0 commit comments

Comments
 (0)