HeightPreference

@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
struct HeightPreference : PreferenceKey

Collects height of all the cells, with reduce takes the maximum value for the given key

  • Declaration

    Swift

    typealias Value = [Int : CGFloat]
  • provide a default value for custom dependency

    Declaration

    Swift

    static let defaultValue: HeightPreference.Value
  • Declaration

    Swift

    static func reduce(value: inout Value, nextValue: () -> Value)