Skip to content

WaterfallGrid 1.0.0 Migration Guide

Paolo Leonardi edited this page Nov 29, 2020 · 3 revisions

This guide is provided in order to ease the transition of existing applications using WaterfallGrid 0.x.x to the latest APIs, as well as explain the design and structure of new and changed functionality.

Breaking API Changes

ScrollView

The grid is no longer embedded in a ScrollView at the library level. Wrap WaterfallGrid in ScrollView if the view needs to be scrollable.

ScrollView {
  WaterfallGrid(rectangles, content: RectangleView.init)
}

Hide Scroll Indicators

from:

WaterfallGrid(rectangles, content: RectangleView.init)
.scrollOptions(showsIndicators: false)

to:

ScrollView(showsIndicators: false) {
  WaterfallGrid(rectangles, content: RectangleView.init)
}

Horizontal Scroll Direction

from:

WaterfallGrid(rectangles, content: RectangleView.init)
.scrollOptions(direction: .horizontal)

to:

ScrollView(.horizontal, showsIndicators: false) {
  WaterfallGrid(rectangles, content: RectangleView.init)
  .scrollOptions(direction: .horizontal)
}

Padding

Removed padding option from gridStyle, to apply a padding to the grid call SwiftUI func padding(...) -> some View.

from:

WaterfallGrid(rectangles, content: RectangleView.init)
.gridStyle(padding: EdgeInsets(top: 16, leading: 8, bottom: 16, trailing: 8))

to:

WaterfallGrid(rectangles, content: RectangleView.init)
.padding(EdgeInsets(top: 16, leading: 8, bottom: 16, trailing: 8))
Clone this wiki locally