Created
April 22, 2018 14:47
-
-
Save malcommac/e3390a7ab0b5d94f26720af5c14fa8d4 to your computer and use it in GitHub Desktop.
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
// 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