Skip to content

Commit

Permalink
Add LayoutGuide to method docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jduff committed Jun 16, 2017
1 parent 7a7d208 commit e236734
Showing 1 changed file with 20 additions and 22 deletions.
42 changes: 20 additions & 22 deletions Pins/View+Pins.swift
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,10 @@ public extension Pinnable where Self: Pinnable {
/// Pin view boundries to the corresponding anchors on the specified views. Calling this method sets `translatesAutoresizingMaskIntoConstraints` to `false` on the caller.
///
/// - Parameters:
/// - leading: Optional view to pin the left of this view to. Must be a `View`.
/// - top: Optional view to pin the top of this view to. Must be a `View`.
/// - trailing: Optional view to pin the right of this view to. Must be a `View`.
/// - bottom: Optional view to pin the bottom of this view to. Must be a `View`.
/// - leading: Optional view to pin the left of this view to. Must be a `View` or `LayoutGuide`.
/// - top: Optional view to pin the top of this view to. Must be a `View` or `LayoutGuide`.
/// - trailing: Optional view to pin the right of this view to. Must be a `View` or `LayoutGuide`.
/// - bottom: Optional view to pin the bottom of this view to. Must be a `View` or `LayoutGuide`.
/// - padding: Optional padding to add between the anchors.
/// - Returns: Array of activated `NSLayoutConstraint` objects that were created.
@discardableResult
Expand All @@ -144,7 +144,7 @@ public extension Pinnable where Self: Pinnable {
/// Pin view boundries to the specified view. Calling this method sets `translatesAutoresizingMaskIntoConstraints` to `false` on the caller.
///
/// - Parameters:
/// - view: View to pin this view to. Must be a `View`.
/// - view: View to pin this view to. Must be a `View` or `LayoutGuide`.
/// - padding: Optional padding to add between the anchors.
/// - Returns: Array of activated `NSLayoutConstraint` objects that were created.
@discardableResult
Expand Down Expand Up @@ -176,12 +176,11 @@ public extension Pinnable where Self: Pinnable {
/// Pin view horizontal anchors to the corresponding anchors on the specified views. Calling this method sets `translatesAutoresizingMaskIntoConstraints` to `false` on the caller.
///
/// - Parameters:
/// - leading: Optional view to pin the leading of this view to. Must be a `View`.
/// - trailing: Optional view to pin the trailing of this view to. Must be a `View`.
/// - leading: Optional view to pin the leading of this view to. Must be a `View` or `LayoutGuide`.
/// - trailing: Optional view to pin the trailing of this view to. Must be a `View` or `LayoutGuide`.
/// - padding: Optional padding to add between the anchors.
/// - Returns: Array of activated `NSLayoutConstraint` objects that were created.
@discardableResult

public func pin<View:Pinnable>(leadingTo leading: View, trailingTo trailing: View, padding: CGFloat = 0.0) -> [NSLayoutConstraint] {

return [pin(.leading, to: leading, padding: padding),
Expand All @@ -205,12 +204,11 @@ public extension Pinnable where Self: Pinnable {
/// Pin view horizontal anchors to the corresponding anchors on the specified views. Calling this method sets `translatesAutoresizingMaskIntoConstraints` to `false` on the caller.
///
/// - Parameters:
/// - left: Optional view to pin the left of this view to. Must be a `View`.
/// - right: Optional view to pin the right of this view to. Must be a `View`.
/// - left: Optional view to pin the left of this view to. Must be a `View` or `LayoutGuide`.
/// - right: Optional view to pin the right of this view to. Must be a `View` or `LayoutGuide`.
/// - padding: Optional padding to add between the anchors.
/// - Returns: Array of activated `NSLayoutConstraint` objects that were created.
@discardableResult

public func pin<View: Pinnable>(leftTo left: View, rightTo right: View, padding: CGFloat = 0.0) -> [NSLayoutConstraint] {

return [pin(.left, to: left, padding: padding),
Expand All @@ -234,8 +232,8 @@ public extension Pinnable where Self: Pinnable {
/// Pin view vertical anchors to the corresponding anchors on the specified views. Calling this method sets `translatesAutoresizingMaskIntoConstraints` to `false` on the caller.
///
/// - Parameters:
/// - top: Optional view to pin the top of this view to. Must be a `View`.
/// - bottom: Optional view to pin the bottom of this view to. Must be a `View`.
/// - top: Optional view to pin the top of this view to. Must be a `View` or `LayoutGuide`.
/// - bottom: Optional view to pin the bottom of this view to. Must be a `View` or `LayoutGuide`.
/// - padding: Optional padding to add between the anchors.
/// - Returns: Array of activated `NSLayoutConstraint` objects that were created.
@discardableResult
Expand Down Expand Up @@ -296,7 +294,7 @@ public extension Pinnable where Self: Pinnable {
///
/// - Parameters:
/// - edge: `HorizontalAnchor` of the caller to pin to. One of `leading`, `trailing`, `left`, `right` or `centerX`.
/// - view: View to pin the caller to. Pins to the same anchor as `edge`. Must be a `View`.
/// - view: View to pin the caller to. Pins to the same anchor as `edge`. Must be a `View` or `LayoutGuide`.
/// - padding: Optional padding to add between the anchors.
/// - Returns: The activated `NSLayoutConstraint` object that was created.
@discardableResult
Expand All @@ -311,7 +309,7 @@ public extension Pinnable where Self: Pinnable {
///
/// - Parameters:
/// - edge: `HorizontalAnchor` of the caller to pin to. One of `leading`, `trailing`, `left`, `right` or `centerX`.
/// - view: View to pin the caller to. Pins to the same anchor as `edge`. Must be a `View`.
/// - view: View to pin the caller to. Pins to the same anchor as `edge`. Must be a `View` or `LayoutGuide`.
/// - padding: Optional padding to add between the anchors.
/// - Returns: The activated `NSLayoutConstraint` object that was created.
@discardableResult
Expand All @@ -326,7 +324,7 @@ public extension Pinnable where Self: Pinnable {
///
/// - Parameters:
/// - edge: `HorizontalAnchor` of the caller to pin to. One of `leading`, `trailing`, `left`, `right` or `centerX`.
/// - view: View to pin the caller to. Pins to the same anchor as `edge`. Must be a `View`.
/// - view: View to pin the caller to. Pins to the same anchor as `edge`. Must be a `View` or `LayoutGuide`.
/// - padding: Optional padding to add between the anchors.
/// - Returns: The activated `NSLayoutConstraint` object that was created.
@discardableResult
Expand Down Expand Up @@ -386,7 +384,7 @@ public extension Pinnable where Self: Pinnable {
///
/// - Parameters:
/// - edge: `VerticalAnchor` of the caller to pin to. One of `top`, `bottom`, `centerY`, `firstBaseline` or `lastBaseline`.
/// - view: View to pin the caller to. Pins to the same anchor as `edge`. Must be a `View`.
/// - view: View to pin the caller to. Pins to the same anchor as `edge`. Must be a `View` or `LayoutGuide`.
/// - padding: Optional padding to add between the anchors.
/// - Returns: The activated `NSLayoutConstraint` object that was created.
@discardableResult
Expand All @@ -401,7 +399,7 @@ public extension Pinnable where Self: Pinnable {
///
/// - Parameters:
/// - edge: `VerticalAnchor` of the caller to pin to. One of `top`, `bottom`, `centerY`, `firstBaseline` or `lastBaseline`.
/// - view: View to pin the caller to. Pins to the same anchor as `edge`. Must be a `View`.
/// - view: View to pin the caller to. Pins to the same anchor as `edge`. Must be a `View` or `LayoutGuide`.
/// - padding: Optional padding to add between the anchors.
/// - Returns: The activated `NSLayoutConstraint` object that was created.
@discardableResult
Expand All @@ -416,7 +414,7 @@ public extension Pinnable where Self: Pinnable {
///
/// - Parameters:
/// - edge: `VerticalAnchor` of the caller to pin to. One of `top`, `bottom`, `centerY`, `firstBaseline` or `lastBaseline`.
/// - view: View to pin the caller to. Pins to the same anchor as `edge`. Must be a `View`.
/// - view: View to pin the caller to. Pins to the same anchor as `edge`. Must be a `View` or `LayoutGuide`.
/// - padding: Optional padding to add between the anchors.
/// - Returns: The activated `NSLayoutConstraint` object that was created.
@discardableResult
Expand Down Expand Up @@ -473,7 +471,7 @@ public extension Pinnable where Self: Pinnable {
///
/// - Parameters:
/// - dimension: `DimensionAnchor` of the caller to pin to. Either `width` or `height`.
/// - view: View to pin the caller to. Pins to the same anchor as `edge`. Must be a `View`.
/// - view: View to pin the caller to. Pins to the same anchor as `edge`. Must be a `View` or `LayoutGuide`.
/// - padding: Optional padding to add between the anchors.
/// - Returns: The activated `NSLayoutConstraint` object that was created.
@discardableResult
Expand All @@ -487,7 +485,7 @@ public extension Pinnable where Self: Pinnable {
///
/// - Parameters:
/// - dimension: `DimensionAnchor` of the caller to pin to. Either `width` or `height`.
/// - view: View to pin the caller to. Pins to the same anchor as `edge`. Must be a `View`.
/// - view: View to pin the caller to. Pins to the same anchor as `edge`. Must be a `View` or `LayoutGuide`.
/// - padding: Optional padding to add between the anchors.
/// - Returns: The activated `NSLayoutConstraint` object that was created.
@discardableResult
Expand All @@ -501,7 +499,7 @@ public extension Pinnable where Self: Pinnable {
///
/// - Parameters:
/// - dimension: `DimensionAnchor` of the caller to pin to. Either `width` or `height`.
/// - view: View to pin the caller to. Pins to the same anchor as `edge`. Must be a `View`.
/// - view: View to pin the caller to. Pins to the same anchor as `edge`. Must be a `View` or `LayoutGuide`.
/// - padding: Optional padding to add between the anchors.
/// - Returns: The activated `NSLayoutConstraint` object that was created.
@discardableResult
Expand Down

0 comments on commit e236734

Please sign in to comment.