### MosaicGrid Installation Source: https://github.com/hainayanda/mosaicgrid/blob/main/README.md Instructions for installing the MosaicGrid library using CocoaPods and Swift Package Manager (Xcode and Package.swift). ```ruby pod 'MosaicGrid', '~> 2.0.2' ``` ```swift .package(url: "https://github.com/hainayanda/MosaicGrid.git", .upToNextMajor(from: "2.0.2")) ``` ```swift dependencies: [ .package(url: "https://github.com/hainayanda/MosaicGrid.git", .upToNextMajor(from: "2.0.2")) ] .target( name: "MyModule", dependencies: ["MosaicGrid"]) ) ``` -------------------------------- ### SpacerTile Usage Source: https://github.com/hainayanda/mosaicgrid/blob/main/README.md SpacerTile is a utility to create empty rectangular spaces within the mosaic grid. It requires grid guides to be defined by HMosaicGrid or VMosaicGrid to function correctly. ```swift VMosaicGrid(hGridCount: 3, spacing: 2) { ForEach(models) { MyView(from: model) .usingGrids(h: model.width, v: model.height) // spacer that fills grid 3x1 SpacerTile(h: 3, v: 1) } } ``` -------------------------------- ### VMosaicGrid Initializers Source: https://github.com/hainayanda/mosaicgrid/blob/main/README.md Provides the different initializers available for VMosaicGrid, allowing customization of grid count, spacing, aspect ratio, and fixed height. ```swift public init(hGridCount: Int, spacing: MosaicGridSpacing = .zero, gridAspectRatio: Double = 1, @ViewBuilder content: @escaping () -> Content) { ... } ``` ```swift public init(hGridCount: Int, spacing: MosaicGridSpacing = .zero, gridHeight: CGFloat, @ViewBuilder content: @escaping () -> Content) { ... } ``` ```swift public init(gridSize: CGSize, minimumSpacing: MosaicGridSpacing = .zero, @ViewBuilder content: @escaping () -> Content) { ... } ``` ```swift public init(spacing: MosaicGridSpacing = .zero, @ViewBuilder content: @escaping () -> Content) { ... } ``` -------------------------------- ### HMosaicGrid Initialization Source: https://github.com/hainayanda/mosaicgrid/blob/main/README.md HMosaicGrid is a horizontal mosaic grid view that fills vertical grids and expands to the right. It offers multiple initializers to customize grid count, spacing, and aspect ratio. ```swift HMosaicGrid(vGridCount: 3, spacing: 2) { ForEach(models) { MyView(from: model) .usingGrids(h: model.width, v: model.height) } } ``` ```swift public init(vGridCount: Int, spacing: MosaicGridSpacing = .zero, gridAspectRatio: Double = 1, @ViewBuilder content: @escaping () -> Content) { ... } ``` ```swift public init(vGridCount: Int, spacing: MosaicGridSpacing = .zero, gridWidth: CGFloat, @ViewBuilder content: @escaping () -> Content) { ... } ``` ```swift public init(gridSize: CGSize, minimumSpacing: MosaicGridSpacing = .zero, @ViewBuilder content: @escaping () -> Content) { ... } ``` ```swift public init(spacing: MosaicGridSpacing = .zero, @ViewBuilder content: @escaping () -> Content) { ... } ``` -------------------------------- ### VMosaicGrid Usage Source: https://github.com/hainayanda/mosaicgrid/blob/main/README.md Demonstrates how to use VMosaicGrid for vertical mosaic layouts in SwiftUI. It shows how to specify grid counts, spacing, and use the .usingGrids modifier for item placement. ```swift VMosaicGrid(hGridCount: 3, spacing: 2) { ForEach(models) { model in MyView(from: model) .usingGrids(h: model.width, v: model.height) } } ``` -------------------------------- ### MosaicGridSpacing Configuration Source: https://github.com/hainayanda/mosaicgrid/blob/main/README.md MosaicGridSpacing defines horizontal and vertical spacing for mosaic grids. It can be initialized with integer or double literals, or explicitly with horizontal and vertical values. ```swift // Using Integer literal VMosaicGrid(hGridCount: 3, spacing: 2) { ... } ``` ```swift // Using Double literal VMosaicGrid(hGridCount: 3, spacing: 2.0) { ... } ``` ```swift // Using MosaicGridSpacing. h is horizontal spacing, v is vertical spacing VMosaicGrid(hGridCount: 3, spacing: .init(h: 2, v: 2)) { ... } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.