     }
 }
 
+public protocol SquareMosaicLayoutDataSource: class {
+    
+    func pattern() -> SquareMosaicPattern
+}
+
 public protocol SquareMosaicLayoutDelegate: class {
     
-    var pattern: SquareMosaicPattern { get }
+    func layoutHeight(_ height: CGFloat) -> Void
 }
 
 private extension UICollectionView {

            }
            cache.append(attributes)
        }
    }
    
    override public func layoutAttributesForItem(at indexPath: IndexPath) -> UICollectionViewLayoutAttributes? {

    }
    
    override public func prepare() {
        guard let dataSource = dataSource else { return }
        guard let view = collectionView else { return }
        guard cache.isEmpty else { return }
        for section in 0..<view.numberOfSections {
            var attributes = [UICollectionViewLayoutAttributes]()
            let rows = view.numberOfItems(inSection: section)
            var row: Int = 0
            let layouts = dataSource.pattern().layouts(rows)
            for layout in layouts {
                guard row < rows else { break }
                let frames = layout.frames(origin: layoutHeight, width: view.layoutWidth)
