AnyCellViewModel

@MainActor
public struct AnyCellViewModel : CellViewModel
extension AnyCellViewModel: Equatable
extension AnyCellViewModel: Hashable
extension AnyCellViewModel: CustomDebugStringConvertible

A type-erased cell view model.

Note

When providing cells with mixed data types to a SectionViewModel, it is necessary to convert them to AnyCellViewModel.

Init

  • Initializes an AnyCellViewModel from the provided cell view model.

    Declaration

    Swift

    public init<T>(_ viewModel: T) where T : CellViewModel

    Parameters

    viewModel

    The view model to type-erase.