Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save bigMOTOR/18f58fd1ba33aa24573030e7e62a9f7f to your computer and use it in GitHub Desktop.
Save bigMOTOR/18f58fd1ba33aa24573030e7e62a9f7f to your computer and use it in GitHub Desktop.
2021-01-30_Article_DataDrivenRxDatasources_5.swift
struct MyAnimatableTableViewModel {
let sections: Driver<[AnimatableTableSectionModel<String>]>
init(repository = SomeRepository()) {
sections = repository.models
.map {
[AnimatableTableSectionModel(model: "Your Section Header",
items: [
XibCellViewModel(value: id1, onSelected: { print("---") }),
XibCellViewModel(value: id1, onSelected: { print("+++") }),
OtherXibCellViewModel(title: "Some Name")
]
)]
}
.asDriver(onErrorJustReturn: [])
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment