Skip to content

Commit

Permalink
Adds doumentation
Browse files Browse the repository at this point in the history
  • Loading branch information
s4cha committed Jan 21, 2017
1 parent 9b7e955 commit 6109527
Showing 1 changed file with 102 additions and 0 deletions.
102 changes: 102 additions & 0 deletions Source/Stevia+Alignment.swift
Original file line number Diff line number Diff line change
Expand Up @@ -135,44 +135,146 @@ private func align(_ axis: UILayoutConstraintAxis, v1: UIView, with v2: UIView,
}

// MARK: Align sides

/** Aligns tops of an array of views
Example Usage:
```
alignTops(label,button,arrow)
```
Ca also be used directly on horizontal layouts since they return the array of views :
```
alignTops(|-image1-image2-image3-|)
```
- Returns: The array of views, enabling chaining,
*/
@discardableResult
public func alignTops(_ views: UIView...) -> [UIView] {
return alignTops(views)
}

/** Aligns tops of an array of views
Example Usage:
```
alignTops(label,button,arrow)
```
Ca also be used directly on horizontal layouts since they return the array of views :
```
alignTops(|-image1-image2-image3-|)
```
- Returns: The array of views, enabling chaining,
*/
@discardableResult
public func alignTops(_ views: [UIView]) -> [UIView] {
align(.top, views: views)
return views
}

/** Aligns bottoms of an array of views
Example Usage:
```
alignBottoms(label,button,arrow)
```
Ca also be used directly on horizontal layouts since they return the array of views :
```
alignBottoms(|-image1-image2-image3-|)
```
- Returns: The array of views, enabling chaining,
*/
@discardableResult
public func alignBottoms(_ views: UIView...) -> [UIView] {
return alignBottoms(views)
}

/** Aligns bottoms of an array of views
Example Usage:
```
alignBottoms(label,button,arrow)
```
Ca also be used directly on horizontal layouts since they return the array of views :
```
alignBottoms(|-image1-image2-image3-|)
```
- Returns: The array of views, enabling chaining,
*/
@discardableResult
public func alignBottoms(_ views: [UIView]) -> [UIView] {
align(.bottom, views: views)
return views
}


/** Aligns left sides of an array of views
Example Usage:
```
alignLefts(label,field,button)
```
- Returns: The array of views, enabling chaining,
*/
@discardableResult
public func alignLefts(_ views: UIView...) -> [UIView] {
return alignLefts(views)
}

/** Aligns left sides of an array of views
Example Usage:
```
alignLefts(label,field,button)
```
- Returns: The array of views, enabling chaining,
*/
@discardableResult
public func alignLefts(_ views: [UIView]) -> [UIView] {
align(.left, views: views)
return views
}

/** Aligns right sides of an array of views
Example Usage:
```
alignRights(label,field,button)
```
- Returns: The array of views, enabling chaining,
*/
@discardableResult
public func alignRights(_ views: UIView...) -> [UIView] {
return alignRights(views)
}

/** Aligns right sides of an array of views
Example Usage:
```
alignRights(label,field,button)
```
- Returns: The array of views, enabling chaining,
*/
@discardableResult
public func alignRights(_ views: [UIView]) -> [UIView] {
align(.right, views: views)
Expand Down

0 comments on commit 6109527

Please sign in to comment.