Skip to content

Commit

Permalink
Document new features
Browse files Browse the repository at this point in the history
  • Loading branch information
Baris Sencan committed Feb 27, 2015
1 parent 5fd25f1 commit 1d4ad62
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,47 @@ So basically, *setting a normal edge's position drags the whole view along with

```swift
var top: CGFloat // Top layout guide y coordinate. Read-only.
var right: CGFloat // Equal to the width of the controller's view. Read-only. For convenience.
var bottom: CGFloat // Bottom layout guide y coordinate. Read-only.
var left: CGFloat // Always equal to 0. Read-only. For convenience.
```

###Helper Methods

```swift
func inset(view: UIView, amount: CGFloat) -> CGRect
func inset(layer: CALayer, amount: CGFloat) -> CGRect
func inset(rect: CGRect, amount: CGFloat) -> CGRect

func inset(view: UIView, dx: CGFloat, dy: CGFloat) -> CGRect
func inset(layer: CALayer, dx: CGFloat, dy: CGFloat) -> CGRect
func inset(rect: CGRect, dx: CGFloat, dy: CGFloat) -> CGRect

func inset(view: UIView, top: CGFloat, left: CGFloat, bottom: CGFloat, right: CGFloat) -> CGRect
func inset(layer: CALayer, top: CGFloat, left: CGFloat, bottom: CGFloat, right: CGFloat) -> CGRect
func inset(rect: CGRect, top: CGFloat, left: CGFloat, bottom: CGFloat, right: CGFloat) -> CGRect
```

```swift
func offset(view: UIView, amount: CGFloat) -> CGRect
func offset(layer: CALayer, amount: CGFloat) -> CGRect
func offset(rect: CGRect, amount: CGFloat) -> CGRect

func offset(view: UIView, dx: CGFloat, dy: CGFloat) -> CGRect
func offset(layer: CALayer, dx: CGFloat, dy: CGFloat) -> CGRect
func offset(rect: CGRect, dx: CGFloat, dy: CGFloat) -> CGRect {
```

These functions never modify the view/layer/rectangle they are passed.

###Smart Assign Operator

The smart assign operator `=~` has only one job; to make your life easier.

```swift
someView.origin =~ (0, 20)
anotherView.size =~ (100, 100)
yetAnotherView.frame =~ (0, 120, view.width, 100)
```

###CALayer/UIView Methods
Expand Down

0 comments on commit 1d4ad62

Please sign in to comment.