 
     func addCenterYConstraintsToView(view: UIView, offset: CGFloat) {
         self.addConstraint(NSLayoutConstraint(item: self, attribute: .CenterY, relatedBy: .Equal, toItem: view, attribute: .CenterY, multiplier: 1.0, constant: -offset))
+    }
+
+    // pin to all subviews
+
+    func pinSubviewToAllEdges(subview: UIView) {
+
+        subview.translatesAutoresizingMaskIntoConstraints = false
+
+        let left = NSLayoutConstraint(item: self, attribute: .Left, relatedBy: .Equal, toItem: subview, attribute: .Left, multiplier: 1.0, constant: 0.0)
+        let right = NSLayoutConstraint(item: self, attribute: .Right, relatedBy: .Equal, toItem: subview, attribute: .Right, multiplier: 1.0, constant: 0.0)
+        let top = NSLayoutConstraint(item: self, attribute: .Top, relatedBy: .Equal, toItem: subview, attribute: .Top, multiplier: 1.0, constant: 0.0)
+        let bottom = NSLayoutConstraint(item: self, attribute: .Bottom, relatedBy: .Equal, toItem: subview, attribute: .Bottom, multiplier: 1.0, constant: 0.0)
+
+        self.addConstraints([left, right, top, bottom])
     }
 
     // Height and Width

            return theResult
        } else {
            return nil
        }
    }
}

        return String(format: "%d%@", self, suffix)
    }
}

extension UITableViewCell {

    // regulatory
    static var nib: UINib {
        let className = self.className
        return UINib(nibName: className, bundle: NSBundle.mainBundle())
    }

    static var cellReuseIdentifier: String {
        return self.className
    }

    static var className: String {
        return self.classForCoder().description().componentsSeparatedByString(".")[1]
    }
    
}

extension UICollectionViewCell {

    // regulatory
    static var nib: UINib {
        let className = self.className
        return UINib(nibName: className, bundle: NSBundle.mainBundle())
    }

    static var cellReuseIdentifier: String {
        return self.className
    }

    static var className: String {
        return self.classForCoder().description().componentsSeparatedByString(".")[1]
    }
    
}
