Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// Register adapter to show contacts
let contactsAdapter = TableAdapter<Contact,ContactCell>()
manager.register(contactsAdapter)
contactsAdapter.on.dequeue { ctx in
ctx.cell?.fullNameLabel.text = (ctx.model.firstName + " " + ctx.model.lastName)
}
let groupsAdapter = TableAdapter<ContactGroup,GroupCell>()
manager.register(contactsAdapter)
contactsAdapter.on.dequeue { ctx in
ctx.cell?.groupLabel.text = ctx.model.name
}
let groupSection = TableSection(header: "GROUPS", items: groupModelsArray)
let peopleSection = TableSection(header: "PEOPLE", items: peopleModelsArray)
manager.addSections([groupSection,peopleSection])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment