 
     // Credit: http://stackoverflow.com/a/23157272
 
-    public func addBorder(edges edges: UIRectEdge, color: UIColor = UIColor.whiteColor(), thickness: CGFloat = 1) -> [UIView] {
+    public func addBorder(edges edges: UIRectEdge, color: UIColor = UIColor.whiteColor(), thickness: CGFloat = 1, padding: UIEdgeInsets = .zero) -> [UIView] {
         var borders = [UIView]()
+        let metrics = ["thickness": thickness, "paddingTop": padding.top, "paddingLeft": padding.left, "paddingBottom": padding.bottom, "paddingRight": padding.right]
 
         func border() -> UIView {
             let border = UIView(frame: .zero)

        if edges.contains(.Left) || edges.contains(.All) {
            let left = border()
            addSubview(left)
            NSLayoutConstraint.constraintsWithVisualFormat("H:|-(0)-[left(==thickness)]",
                options: [],
                metrics: ["thickness": thickness],
                views: ["left": left]).activate()
            NSLayoutConstraint.constraintsWithVisualFormat("V:|-(0)-[left]-(0)-|",
                options: [],
                metrics: nil,
                views: ["left": left]).activate()
            borders.append(left)
        }

        if edges.contains(.Bottom) || edges.contains(.All) {
            let bottom = border()
            addSubview(bottom)
            NSLayoutConstraint.constraintsWithVisualFormat("V:[bottom(==thickness)]-paddingBottom-|",
                options: [],
                metrics: metrics,
                views: ["bottom": bottom]).activate()
            NSLayoutConstraint.constraintsWithVisualFormat("H:|-paddingLeft-[bottom]-paddingRight-|",
                options: [],
                metrics: metrics,
                views: ["bottom": bottom]).activate()
            borders.append(bottom)
        }
