SupplementaryViewModel

@MainActor
public protocol SupplementaryViewModel : DiffableViewModel, ViewRegistrationProvider

Defines a view model that describes and configures a supplementary view in a collection.

  • The type of view that this view model represents and configures.

    Declaration

    Swift

    associatedtype ViewType : UICollectionReusableView
  • Configures the provided view for display in the collection.

    Declaration

    Swift

    func configure(view: ViewType)

    Parameters

    view

    The view to configure.

  • viewClass Extension method

    The view class for this view model.

    Declaration

    Swift

    public var viewClass: AnyClass { get }
  • reuseIdentifier Extension method

    A default reuse identifier for cell registration. Returns the name of the class implementing the CellViewModel protocol.

    Declaration

    Swift

    public var reuseIdentifier: String { get }
  • eraseToAnyViewModel() Extension method

    Returns a type-erased version of this view model.

    Declaration

    Swift

    public func eraseToAnyViewModel() -> AnySupplementaryViewModel