Skip to content

Commit

Permalink
Read me
Browse files Browse the repository at this point in the history
  • Loading branch information
melvitax committed Dec 7, 2016
1 parent d62f5b3 commit f61fb77
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions README.md
@@ -1,4 +1,4 @@
# AFViewHelper
# ViewHelper

[![Version](https://img.shields.io/cocoapods/v/AFViewHelper.svg?style=flat)](http://cocoapods.org/pods/AFViewHelper)
[![License](https://img.shields.io/cocoapods/l/AFViewHelper.svg?style=flat)](http://cocoapods.org/pods/AFViewHelper)
Expand All @@ -8,7 +8,7 @@
Autolayout and View Animation Helper for Swift 3.0


![Sample Project Screenshot](https://raw.githubusercontent.com/melvitax/AFViewHelper/master/Screenshot.png?raw=true "Sample Project Screenshot")
![Sample Project Screenshot](https://raw.githubusercontent.com/melvitax/ViewHelper/master/Screenshot.png?raw=true "Sample Project Screenshot")


## Animations
Expand All @@ -20,7 +20,7 @@ view.animate(.Shake, curve: .EaseInOutBack)
view.animate(.Shake, curve: .EaseInOutBack, duration: 0.8, delay: 0, force: 1, damping: 0.7,velocity: 1, fromRotation: 0, fromScale: 1.5, fromX: 0, fromY: 0)
```

## Auto Layout
## Auto Layout

```swift
let box = UIView(autoLayout:true)
Expand Down Expand Up @@ -63,7 +63,7 @@ let widthConstraint = view.applyAttribute(.Width, constant: 100, multiplier: 0.

## UIView Extension

### Prepping for Auto Layout
### Prepping for Auto Layout

If a view is already in place with frames, prepForAutoLayout() will remove it from view, enable Auto Layout and place back in view.

Expand All @@ -79,10 +79,10 @@ If a view uses auto layout but you need to animate it using frames, prepForAnima
view.prepForAnimation()
```

### Instantiate
### Instantiate

Instantiates a new UIView with Auto Layout

```swift
convenience init(autoLayout: Bool = true)
```
Expand All @@ -92,15 +92,15 @@ convenience init(autoLayout: Bool = true)
#### Origin

Returns the frame's origin

```swift
origin() -> CGPoint
```

Pins the frame's top and left sides using Auto Layout or frames

```swift
origin(constant: CGPoint) -> UIView
origin(constant: CGPoint) -> UIView
```
Pins left and top sides to another view using Auto Layout

Expand All @@ -112,7 +112,7 @@ origin(to to:AnyObject, constant: CGPoint = CGPoint(x: 0, y: 0), multiplier:CGFl
Returns the min x point

```swift
left() -> CGFloat
left() -> CGFloat
```

Pins the left side using Auto Layout or frames
Expand Down Expand Up @@ -157,7 +157,7 @@ right() -> CGFloat
Pins the right side using Auto Layout or frames

```swift
right(constant: CGFloat) -> UIView
right(constant: CGFloat) -> UIView
```

Pins the right side to another view using Auto Layout
Expand All @@ -176,7 +176,7 @@ trailing() -> CGFloat
Pins the trailing side using Auto Layout or frames

```swift
trailing(constant: CGFloat) -> UIView
trailing(constant: CGFloat) -> UIView
```

Pins the trailing side to another view using Auto Layout
Expand All @@ -190,7 +190,7 @@ trailing(to to:AnyObject, attribute: NSLayoutAttribute = .Trailing, constant: CG
Returns the top side value

```swift
top() -> CGFloat
top() -> CGFloat
```

Pins the top side using Auto Layout or frames
Expand All @@ -216,13 +216,13 @@ bottom() -> CGFloat
Pins the bottom side using Auto Layout or frames

```swift
bottom(constant: CGFloat) -> UIView
bottom(constant: CGFloat) -> UIView
```

Pins the bottom side to another view using Auto Layout

```swift
bottom(to to:AnyObject, attribute: NSLayoutAttribute = .Bottom, constant: CGFloat = 0, multiplier:CGFloat = 1) -> UIView
bottom(to to:AnyObject, attribute: NSLayoutAttribute = .Bottom, constant: CGFloat = 0, multiplier:CGFloat = 1) -> UIView
```

#### Center
Expand All @@ -236,7 +236,7 @@ center(constant: CGPoint = CGPoint(x: 0, y: 0)) -> UIView
Pins the center point to another view using Auto Layout

```swift
center(to to:AnyObject, constant:CGSize = CGSize(width: 0, height: 0), multiplier:CGFloat = 1) -> UIView
center(to to:AnyObject, constant:CGSize = CGSize(width: 0, height: 0), multiplier:CGFloat = 1) -> UIView
```

#### Center X
Expand All @@ -250,7 +250,7 @@ centerX() -> CGFloat
Pins the center X using Auto Layout or frames

```swift
centerX(constant: CGFloat = 0) -> UIView
centerX(constant: CGFloat = 0) -> UIView
```

Pins the center X to another view using Auto Layout
Expand Down Expand Up @@ -292,7 +292,7 @@ horizontalCompressionPriority() -> UILayoutPriority
Sets the Compression Resistance Priority for Horizontal Axis using Auto Layout

```swift
horizontalCompressionPriority(priority: UILayoutPriority) -> UIView
horizontalCompressionPriority(priority: UILayoutPriority) -> UIView
```

Returns the Compression Resistance Priority for Vertical Axis using Auto Layout
Expand Down Expand Up @@ -360,7 +360,7 @@ size(to to:AnyObject, constant: CGSize = CGSize(width: 0, height: 0), multiplier
Returns the frame width

```swift
width() -> CGFloat
width() -> CGFloat
```

Sets the frame width using Auto Layout or frames
Expand Down Expand Up @@ -446,7 +446,7 @@ minHeight() -> CGFloat?
Sets the minimum height using Auto Layout

```swift
minHeight(constant:CGFloat) -> UIView
minHeight(constant:CGFloat) -> UIView
```

Pins the minimum height to another view using Auto Layout
Expand Down Expand Up @@ -548,7 +548,7 @@ prepForAutoLayout()
Pins an attribute to another view

```swift
pin(pinAttribute:NSLayoutAttribute, to:AnyObject? = nil, attribute:NSLayoutAttribute, constant:CGFloat = 0, multiplier:CGFloat = 1, relation:NSLayoutRelation = .Equal) -> NSLayoutConstraint?
pin(pinAttribute:NSLayoutAttribute, to:AnyObject? = nil, attribute:NSLayoutAttribute, constant:CGFloat = 0, multiplier:CGFloat = 1, relation:NSLayoutRelation = .Equal) -> NSLayoutConstraint?
```

Applies an attribute to the view
Expand Down Expand Up @@ -586,7 +586,7 @@ layoutDirectionIsLeftToRight() -> Bool
The layer border color

```swift
var borderColor: UIColor
var borderColor: UIColor
```

The layer border width
Expand All @@ -598,21 +598,21 @@ var borderWidth: CGFloat
Sets layer border with a dash pattern

```swift
borderWithDashPattern(lineDashPattern: [Int], borderWidth: CGFloat, borderColor: UIColor, cornerRadius: CGFloat?) -> UIView
borderWithDashPattern(lineDashPattern: [Int], borderWidth: CGFloat, borderColor: UIColor, cornerRadius: CGFloat?) -> UIView
```

### Rounded Corners

The layer corner radius

```swift
var cornerRadius: CGFloat
var cornerRadius: CGFloat
```

Creates a circle by rounding the corners to half the size of the width, sets border color and width

```swift
roundCornersToCircle(borderColor: UIColor?, borderWidth: CGFloat?) -> UIView
roundCornersToCircle(borderColor: UIColor?, borderWidth: CGFloat?) -> UIView
```

Creates a circle by rounding the corners to hald the size of the width
Expand All @@ -626,7 +626,7 @@ roundCorners(cornerRadius: CGFloat, borderColor: UIColor?, borderWidth: CGFloat?
The shadow color of the layer

```swift
var shadowColor: UIColor
var shadowColor: UIColor
```

The shadow offset of the layer
Expand Down Expand Up @@ -686,7 +686,7 @@ layoutDirectionIsLeftToRight() -> Bool

Returns true if horizontal size class is compact

```swift
```swift
horizontalSizeClassIsCompact() -> Bool
```

Expand Down

0 comments on commit f61fb77

Please sign in to comment.