             multiplier: 1,
             constant: 0)
         addConstraint(centerVertically)
-    }
-
-    func centerChild(childView: UIView) {
-        centerChildHorizontally(childView)
-        centerChildVertically(childView)
+        return centerVertically
+    }
+
+    func centerChild(childView: UIView) -> [NSLayoutConstraint] {
+        return [centerChildHorizontally(childView), centerChildVertically(childView)]
     }
     
     // MARK: - positioning
      
-    func placeAbove(sibling: UIView, by offset: CGFloat = 0) {
-        let superview = self.superview!
-        if (superview != sibling.superview!) {
-            return
+    func placeAbove(sibling: UIView, by offset: CGFloat = 0) -> NSLayoutConstraint {
+        let superview = self.superview!
+        if (superview != sibling.superview!) {
+            fatalError("views do not share the same superview")
         }
         setTranslatesAutoresizingMaskIntoConstraints(false)
         sibling.setTranslatesAutoresizingMaskIntoConstraints(false)

            multiplier: 1,
            constant: inset)
        superview.addConstraint(pin)
    }
    
    func alignVerticallyWith(sibling: UIView) {
        alignDimension(.CenterY, withSibling: sibling)
    }
    
    func alignHorizontallyWith(sibling: UIView) {
        alignDimension(.CenterX, withSibling: sibling)
    }

    func matchWidthOf(sibling: UIView) {
        alignDimension(.Width, withSibling: sibling)
    }

    func matchHeightOf(sibling: UIView) {
        alignDimension(.Height, withSibling: sibling)
    }
    
    private func alignDimension(dimension: NSLayoutAttribute, withSibling sibling: UIView) {
        let superview = self.superview!
        if (superview != sibling.superview!) {
            return
        }
        setTranslatesAutoresizingMaskIntoConstraints(false)
        sibling.setTranslatesAutoresizingMaskIntoConstraints(false)

            multiplier: 1,
            constant: 0)
        superview.addConstraint(align)
        return align
    }
    
    // TODO: this only works if the superview is centered in its superview.
