CollectionViewDriverOptions

public struct CollectionViewDriverOptions : Hashable

Defines various options to customize behavior of a CollectionViewDriver.

  • Specifies whether or not to perform diffing on a background queue. Pass true to perform diffing in the background, pass false to perform diffing on the main thread.

    Declaration

    Swift

    public let diffOnBackgroundQueue: Bool
  • Specifies whether or not the CollectionViewDriver should perform a hard reloadData() when replacing the CollectionViewModel with a new one, or if it should always perform a diff.

    A replacement occurs when providing a new CollectionViewModel to the CollectionViewDriver that has a different id than the previous model.

    Declaration

    Swift

    public let reloadDataOnReplacingViewModel: Bool
  • Initializes a CollectionViewDriverOptions object.

    Declaration

    Swift

    public init(
        diffOnBackgroundQueue: Bool = false,
        reloadDataOnReplacingViewModel: Bool = false
    )

    Parameters

    diffOnBackgroundQueue

    Whether or not to perform diffing on a background queue. Default is false.

    reloadDataOnReplacingViewModel

    Whether or not to reload or diff during replacement. Default is false.