Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
onmyway133 committed May 16, 2017
1 parent 62ba4ed commit 3427854
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions README.md
Expand Up @@ -47,6 +47,34 @@ Most of the time, `NSLayoutAnchor` is what you need. But if you need more, **Anc

### Examples

#### Tetris

Well, you can use Auto Layout to make `Tetris`. Auto Layout plays well with `affine transform` too. See [code](https://github.com/onmyway133/Anchors/tree/master/Example/AnchorsDemo/Content/TetrisView.swift)

<div align = "center">
<img src="Screenshots/tetris.gif" width="400" height="590" />
<br />
<br />
<br />
</div>

```swift
activate(
lineBlock.anchor.left.bottom
)

// later
activate(
firstSquareBlock.anchor.left.equal.to(lineBlock.anchor.right),
firstSquareBlock.anchor.bottom
)

// later
activate(
secondSquareBlock.anchor.right.bottom
)
```

#### Piano

This is how to make a piano using `apply` and `fixed spacing`. See [code](https://github.com/onmyway133/Anchors/tree/master/Example/AnchorsDemo/Content/PianoView.swift)
Expand Down Expand Up @@ -76,34 +104,6 @@ activate(
)
```

#### Tetris

Well, you can use Auto Layout to make `Tetris`. Auto Layout plays well with `affine transform` too. See [code](https://github.com/onmyway133/Anchors/tree/master/Example/AnchorsDemo/Content/TetrisView.swift)

<div align = "center">
<img src="Screenshots/tetris.gif" width="400" height="590" />
<br />
<br />
<br />
</div>

```swift
activate(
lineBlock.anchor.left.bottom
)

// later
activate(
firstSquareBlock.anchor.left.equal.to(lineBlock.anchor.right),
firstSquareBlock.anchor.bottom
)

// later
activate(
secondSquareBlock.anchor.right.bottom
)
```

#### More

More example can be found in [Example](https://github.com/onmyway133/Anchors/tree/master/Example/AnchorsDemo)
Expand Down

0 comments on commit 3427854

Please sign in to comment.