1

I'm getting the following error when using RxTableViewSectionedAnimatedDataSource to a UITableView's rx_itemsAnimatedWithDataSource().

Here's a screengrab of the error:

Xcode Error

Cannot invoke 'rx_itemsAnimatedWithDataSource' with an argument list of type '(RxTableViewSectionedAnimatedDataSource)'

Expected an argument list of type '(DataSource)'

self.dataSource is of type:

RxTableViewSectionedAnimatedDataSource< DateSelectorSectionModel>

and here's the generated interface for DateSelectorSectionModel, plus related types:

typealias DateSelectorSectionModel = SectionModel<SectionDesc, SectionDesc>

enum SectionType {
    case StartDate, EndDate, TimeZone, AllDay
}

enum SectionState {
    case Present, Missing, Dirty
}

enum SectionSelection {
    case NotSelected, Selected
}

struct SectionDesc {
    var type: SectionType
    var state: SectionState
    var selectionState: SectionSelection
    init(type: SectionType, state: SectionState, selection: SectionSelection)
    public func getSectionModel() -> DateSelectorSectionModel
}

extension EventDetailsDateSelectorViewModel {
    public var rows: RxCocoa.Driver<[DateSelectorSectionModel]> { get }
}

Any ideas? Thanks!

dornad
  • 1,274
  • 3
  • 17
  • 36

1 Answers1

0

I found the issue.

For Animated dataSources, the correct model should be of type HashableSectionModel. Which means that :

// Instead of this:
typealias DateSelectorSectionModel = SectionModel<SectionDesc, SectionDesc>
// Do this:
typealias DateSelectorSectionModel = HashableSectionModel<SectionDesc, SectionDesc>

With this change, everything compiles as expected.

dornad
  • 1,274
  • 3
  • 17
  • 36