Skip to content

Instantly share code, notes, and snippets.

@alobanov
Last active November 8, 2017 08:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alobanov/a2c1880e5e52d0cfcd0b17d9edcfe8e4 to your computer and use it in GitHub Desktop.
Save alobanov/a2c1880e5e52d0cfcd0b17d9edcfe8e4 to your computer and use it in GitHub Desktop.
Пример создания
// создаем корневой контейнер
self.datasource = BaseCompoundItem()
// создаем модели секции
let section1 = SectionCompoundItem(identifier: "Section1", header: "Вселенная MARVEL", footer: "Marvel Comics — американская компания, издающая комиксы, подразделение корпорации «Marvel Entertainment»")
let section2 = SectionCompoundItem(identifier: "Section2", header: "Вселенная DC", footer: "DC Comics — одно из крупнейших и наиболее популярных издательств комиксов, наравне с Marvel Comics")
// создаем модели ячеек
let cap = CellCompoundItem(identifier: "cell2", cellIdentifier: "CellID", title: "Captain America", subtitle: "Стивен Роджерс")
let batman = CellCompoundItem(identifier: "cell5", cellIdentifier: "CellID", title: "Batman", subtitle: "Брюс Вэйн")
// добавляем в секции модели ячеек и в корневой контейнер секции
section1.add(cap)
section2.add(batman)
datasource.add(section1, section2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment