Skip to content

Instantly share code, notes, and snippets.

@DungeonDev78
Last active January 9, 2022 10:14
UITableViewSections007.swift
private extension ViewController {
func createDataSource() -> [Section] {
var sections = [Section]()
if isCharactersEnabled {
sections.append(Section.character(items: characters))
}
if isLocationsEnabled {
sections.append(Section.location(items: locations))
}
if isCoursesEnabled {
sections.append(Section.course(items: courses))
}
return sections
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment