         }
     }
 
-    func _objcPinToView(view: UIView, inset: UIEdgeInsets = UIEdgeInsetsZero) -> [NSLayoutConstraint] {
+    func _objcPinToView(view: UIView, inset: UIEdgeInsets = .zero) -> [NSLayoutConstraint] {
         let viewConstraints: [NSLayoutConstraint] = [
-            self.leadingAnchor.constraintEqualToAnchor(view.leadingAnchor, constant: inset.left),
-            self.trailingAnchor.constraintEqualToAnchor(view.trailingAnchor, constant: inset.right),
-            self.topAnchor.constraintEqualToAnchor(view.topAnchor, constant: inset.top),
-            self.bottomAnchor.constraintEqualToAnchor(view.bottomAnchor, constant: inset.bottom),
+            self.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: inset.left),
+            self.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: inset.right),
+            self.topAnchor.constraint(equalTo: view.topAnchor, constant: inset.top),
+            self.bottomAnchor.constraint(equalTo: view.bottomAnchor, constant: inset.bottom),
             ]
 
         return viewConstraints

                    priority = UILayoutPriorityRequired
                }

                let currentAnchor = self.layoutAnchorForEdge(edge)
                let viewAnchor = view.layoutAnchorForEdge(edge)
                let constraint: NSLayoutConstraint
                if relation == .GreaterThanOrEqual {
                    constraint = currentAnchor.constraintGreaterThanOrEqualToAnchor(viewAnchor, constant: constant)
                } else if relation == .LessThanOrEqual {
                    constraint = currentAnchor.constraintLessThanOrEqualToAnchor(viewAnchor, constant: constant)
                } else {
                    constraint = currentAnchor.constraintEqualToAnchor(viewAnchor, constant: constant)
                }

                constraint.priority = priority

            return nil
        }

        let leadingConstraint = addConstraint(.leading)
        let trailingConstraint = addConstraint(.trailing)
        let topConstraint = addConstraint(.top)
        let bottomConstraint = addConstraint(.bottom)
        let centerXConstraint = addConstraint(.centerX)
        let centerYConstraint = addConstraint(.centerY)
        let widthConstraint = addConstraint(.width)
        let heightConstraint = addConstraint(.height)

        self.translatesAutoresizingMaskIntoConstraints = false

        let viewConstraints = [ leadingConstraint, trailingConstraint, topConstraint, bottomConstraint, centerXConstraint, centerYConstraint, widthConstraint, heightConstraint ].flatMap { $0 }
        viewConstraints.setActive(active: activate)

        return viewConstraints
    }

    func pinEdge(edge: EdgeAnchor, toEdge: EdgeAnchor, ofView: UIView, relation: NSLayoutRelation = .equal, constant: CGFloat = 0.0, priority: UILayoutPriority = UILayoutPriorityRequired, activate: Bool = true) -> NSLayoutConstraint {
        let fromAnchor = self.layoutAnchor(edge: edge)
        let toAnchor = ofView.layoutAnchor(edge: toEdge)

        let constraint: NSLayoutConstraint
        if relation == .greaterThanOrEqual {
            constraint = fromAnchor.constraint(greaterThanOrEqualTo: toAnchor, constant: constant)
        } else if relation == .lessThanOrEqual {
            constraint = fromAnchor.constraint(lessThanOrEqualTo: toAnchor, constant: constant)
        } else {
            constraint = fromAnchor.constraint(equalTo: toAnchor, constant: constant)
        }

        constraint.priority = priority
        constraint.isActive = activate

        return constraint
    }

    func setSize(sizeAnchor: SizeAnchor, relation: NSLayoutRelation = .equal, activate: Bool = true) -> NSLayoutConstraint {
        self.translatesAutoresizingMaskIntoConstraints = false

        let currentDimension = self.layoutDimensionForAnchor(size: sizeAnchor)

        let constraint: NSLayoutConstraint
        if relation == .greaterThanOrEqual {
            constraint = currentDimension.constraint(greaterThanOrEqualToConstant: sizeAnchor.constant)
        } else if relation == .lessThanOrEqual {
            constraint = currentDimension.constraint(lessThanOrEqualToConstant: sizeAnchor.constant)
        } else {
            constraint = currentDimension.constraint(equalToConstant: sizeAnchor.constant)
        }

        constraint.priority = sizeAnchor.priority
        constraint.isActive = activate

        return constraint
    }

    func setSize(sizeAnchors: [SizeAnchor] = [ SizeAnchor.width, SizeAnchor.height ], relation: NSLayoutRelation = .equal, activate: Bool = true) -> [NSLayoutConstraint] {
        return sizeAnchors.map { return self.setSize(sizeAnchor: $0, relation: relation, activate: activate) }
    }

    func setRelativeSize(sizeAnchor: SizeAnchor, toSizeAnchor: SizeAnchor, ofView: UIView, multiplier: CGFloat, constant: CGFloat, relation: NSLayoutRelation = .equal, activate: Bool = true) -> NSLayoutConstraint {
        self.translatesAutoresizingMaskIntoConstraints = false

        let fromDimension = self.layoutDimensionForAnchor(size: sizeAnchor)
        let toDimension = ofView.layoutDimensionForAnchor(size: toSizeAnchor)

        let constraint: NSLayoutConstraint
        if relation == .greaterThanOrEqual {
            constraint = fromDimension.constraint(greaterThanOrEqualTo: toDimension, multiplier: multiplier, constant: constant)
        } else if relation == .lessThanOrEqual {
            constraint = fromDimension.constraint(lessThanOrEqualTo: toDimension, multiplier: multiplier, constant: constant)
        } else {
            constraint = fromDimension.constraint(equalTo: toDimension, multiplier: multiplier, constant: constant)
        }

        constraint.priority = sizeAnchor.priority
        constraint.isActive = activate

        return constraint
    }
