CountsViewModel
protocol CountsViewModel
Abstraction of two and three level hierarchy models
-
Dequeue identifier and cell model group
Declaration
Swift
typealias CellInfo = (identifier: String, model: CountCellModel)
-
Hierarchy of list
Declaration
Swift
var hierarchy: Hierarchy { get }
-
Top level of list: regions or brands
Declaration
Swift
var sectionCount: Int { get }
-
Items in top level
Declaration
Swift
func itemCount(section index: Int) -> Int
-
Model for section header
Declaration
Swift
func header(section index: Int) -> CountSectionModel
-
Info for cell
Declaration
Swift
func cell(info path: IndexPath) -> CellInfo
-
Sort place list into model
Declaration
Swift
mutating func sort(places: [PlaceInfo], visited: [Int])
Parameters
places
PlaceInfos to sort
visited
IDs of visited places
-
Toggle expanded state of section
Declaration
Swift
mutating func toggle(section: String)
Parameters
section
Section
-
Toggle expanded state of group: country or region
Declaration
Swift
mutating func toggle(section: String, group: String)
Parameters
section
Section
group
group
-
Toggle expanded state of subgroup: location or country
Declaration
Swift
mutating func toggle(section: String, group: String, subgroup: String)
Parameters
section
Section
group
group