Skip to content

Instantly share code, notes, and snippets.

@IsaAliev
Created October 18, 2020 09:14
Show Gist options
  • Save IsaAliev/4a624ddbf7e397dba17f29c375afddd6 to your computer and use it in GitHub Desktop.
Save IsaAliev/4a624ddbf7e397dba17f29c375afddd6 to your computer and use it in GitHub Desktop.
let profileImagePath = Bundle.main.path(forResource: profile.imageFileName, ofType: nil) ?? ""
collectionData.onNext([
.init(
model: TextHeaderViewModel(text: "Main Info"),
items: [NamedImageCellModel(name: profile.name, imageFilePath: profileImagePath)]
),
.init(
model: TextHeaderViewModel(text: "About Me"),
items: [TextCellModel(text: profile.about)]
),
.init(
model: TextHeaderViewModel(text: "Attributes"),
items: profile.attributes.map({ AttributeCellModel(name: $0.name, value: $0.value) })
),
])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment