Skip to content

Instantly share code, notes, and snippets.

@gwennguihal
Last active October 2, 2019 16:07
Show Gist options
  • Save gwennguihal/cba12a15b5537b940cf22bae7f633b35 to your computer and use it in GitHub Desktop.
Save gwennguihal/cba12a15b5537b940cf22bae7f633b35 to your computer and use it in GitHub Desktop.
lazy var dataSource = DataSource {
Section {
LabelCell(HeaderAdapter(label: "Example"))
Spacer(32)
}
model.items.ui.map { item in
Section {
Spacer()
LabelCell(TitleAdapter(label: item.title))
item.subTitle.ui.map {
Spacer()
LineCell()
LabelCell(SubtitleAdapter(label: $0))
.onDidSelect(self.onDidSelect(subtitleCell:))
}
Spacer()
item.colors.ui.map {
ContentCell(ContentAdapter(color: $0))
.onDidSelect { print($0.adapter.color) }
}
Spacer(16)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment