         return constraints
     }
 
+    // MARK: Private helper methods.
     private func anchor(for anchor: HorizontalAnchor) -> NSLayoutAnchor<NSLayoutXAxisAnchor> {
         switch anchor {
         case .leading:

        return constraint
    }

    @discardableResult
    func pin(height: CGFloat?, width: CGFloat?) -> [NSLayoutConstraint] {
        var constraints = [NSLayoutConstraint]()

//  Copyright © 2017 John Duff. All rights reserved.
//

/// Horizontal representation that should be used to pin the anchor.
///
/// - leading: The leading edge of the object's alignment rectangle.
/// - trailing: The trailing edge of the object's alignment rectangle.
/// - left: The left side of the object's alignment rectangle.
/// - right: The right side of the object's alignment rectangle.
/// - centerX: The center along the x-axis of the object's alignment rectangle.
public enum HorizontalAnchor {
    case leading, trailing, left, right, centerX
}


/// Vertical representation that should be used to pin the anchor.
///
/// - top: The top of the object's alignment rectangle.
/// - bottom: The bottom of the object's alignment rectangle.
/// - centerY: The center along the y-axis of the object's alignment rectangle.
/// - firstBaseline: The object's baseline. For objects with more than one line of text, this is the baseline for the topmost line of text.
/// - lastBaseline: The object's baseline. For objects with more than one line of text, this is the baseline for the bottommost line of text.
public enum VerticalAnchor {
    case top, bottom, centerY, firstBaseline, lastBaseline
}

/// Dimension representation that should be used to pin the anchor.
///
/// - width: The width of the object's alignment rectangle
/// - height: The height of the object's alignment rectangle
public enum DimensionAnchor {
    case width, height
}

// MARK: - Extentions to add `pin` methods to `UIView` objects.
public extension UIView {

    /// Pin view boundries to the specified anchors. Calling this method sets `translatesAutoresizingMaskIntoConstraints` to `false` on the caller.
    ///
    /// - Parameters:
    ///   - left: Optional anchor to pin the left of the view to. Must be a `NSLayoutXAxisAnchor`.
    ///   - top: Optional anchor to pin the top of the view to. Must be a `NSLayoutYAxisAnchor`.
    ///   - right: Optional anchor to pin the right of the view to. Must be a `NSLayoutXAxisAnchor`.
    ///   - bottom: Optional anchor to pin the bottom of the view to. Must be a `NSLayoutYAxisAnchor`.
    ///   - padding: Optional padding to add between the anchors.
    /// - Returns: Array of activated `NSLayoutConstraint` objects that were created.
    @discardableResult
    func pin(leftTo left: NSLayoutAnchor<NSLayoutXAxisAnchor>?, topTo top: NSLayoutAnchor<NSLayoutYAxisAnchor>?, rightTo right: NSLayoutAnchor<NSLayoutXAxisAnchor>?, bottomTo bottom: NSLayoutAnchor<NSLayoutYAxisAnchor>?, padding: CGFloat = 0.0) -> [NSLayoutConstraint] {
        var constraints = [NSLayoutConstraint]()
