Created
January 30, 2021 18:57
-
-
Save bigMOTOR/18f58fd1ba33aa24573030e7e62a9f7f to your computer and use it in GitHub Desktop.
2021-01-30_Article_DataDrivenRxDatasources_5.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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