Skip to content

Nice article and approach but need help #1

@vstepanyuk

Description

@vstepanyuk

In the code looks like there is some diffing implementation started, but seems like not finished.

I'm trying to make it working with RxDataSources, so far only:

Protocol 'CellConfigurator' can only be used as a generic constraint because it has Self or associated type requirements
when I'm trying to extend CellConfigurator with IdentifiableType.
Maybe you can suggest another some nice hack that could solve this problem.

protocol CellConfigurator: CellSizable, Diffable, SelectableData, IdentifiableType  {
    static var cellType: GenericCell.Type { get }
    static var cellReuseIdentifier: String { get }
    
    func configure(cell: UIView)
    func didSelect()
}

protocol ConfigurableCell: GenericCell, Reusable {
    associatedtype DataType
    func configure(item: DataType)
}

//defines that object should return its configurator
protocol CellConfigurable {
    func configurator() -> CellConfigurator // <- Protocol 'CellConfigurator' can only be used as a generic constraint because it has Self or associated type requirements
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions