         self.frame = CGRect()
     }
 
-    mutating func layoutWith(frame: CGRect) {
+    public mutating func layoutWith(frame: CGRect) {
         self.frame = frame
         let size = sizeThatFitsWithMargins(of: element, size: frame.size)
         var point = CGPoint()

/**
    Simple layout that positions one child according to its gravity.
*/
struct GravityLayout: BayaLayout {
    var layoutMargins: UIEdgeInsets
    var frame: CGRect

    private var element: BayaLayoutable
    private let gravity: (BayaLayoutOptions.Gravity.Horizontal, BayaLayoutOptions.Gravity.Vertical)

            size: size))
    }

    public func sizeThatFits(_ size: CGSize) -> CGSize {
        let fit = sizeThatFitsWithMargins(of: element, size: size)
        return addMargins(size: fit, element: element)
    }
}

public extension BayaLayoutable {
    func layoutGravity(to horizontalGravity: BayaLayoutOptions.Gravity.Horizontal) -> BayaGravityLayout {
        return BayaGravityLayout(
            element: self,
            gravity: (horizontalGravity, .top))
    }

    func layoutGravity(to verticalGravity: BayaLayoutOptions.Gravity.Vertical) -> BayaGravityLayout {
        return BayaGravityLayout(
            element: self,
            gravity: (.left, verticalGravity))
    }

    func layoutGravity(
        horizontally horizontalGravity: BayaLayoutOptions.Gravity.Horizontal,
        vertically verticalGravity: BayaLayoutOptions.Gravity.Vertical) -> BayaGravityLayout {
        return BayaGravityLayout(
            element: self,
            gravity: (horizontalGravity, verticalGravity))
    }
