diff --git a/Sources/Grid/Grid.swift b/Sources/Grid/Grid.swift index 83ee59f..367ae88 100644 --- a/Sources/Grid/Grid.swift +++ b/Sources/Grid/Grid.swift @@ -1,15 +1,10 @@ import SwiftUI -struct GridItem: Identifiable { - let view: AnyView - let id: AnyHashable -} - /// A view that arranges its children in a grid. public struct Grid: View where Content: View { @Environment(\.gridStyle) private var style + @State var itemsPreferences: [AnyHashable : GridItemPreferences] = [:] let items: [GridItem] - @State private var itemsPreferences: [AnyHashable : GridItemPreferences] = [:] public var body: some View { GeometryReader { geometry in diff --git a/Sources/Grid/GridItem.swift b/Sources/Grid/GridItem.swift new file mode 100644 index 0000000..646a848 --- /dev/null +++ b/Sources/Grid/GridItem.swift @@ -0,0 +1,6 @@ +import SwiftUI + +struct GridItem: Identifiable { + let view: AnyView + let id: AnyHashable +}