Last active
November 8, 2017 08:51
-
-
Save alobanov/a2c1880e5e52d0cfcd0b17d9edcfe8e4 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
// создаем корневой контейнер | |
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