Skip to content

Instantly share code, notes, and snippets.

@jeantimex
Last active July 19, 2017 18:50
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 jeantimex/7522b5e52458ffe98097ae5b1cb9b300 to your computer and use it in GitHub Desktop.
Save jeantimex/7522b5e52458ffe98097ae5b1cb9b300 to your computer and use it in GitHub Desktop.
Section Structure
struct Section {
var name: String
var items: [String]
var collapsed: Bool
init(name: String, items: [Item], collapsed: Bool = false) {
self.name = name
self.items = items
self.collapsed = collapsed
}
}
var sections = [Section]()
sections = [
Section(name: "Mac", items: ["MacBook", "MacBook Air"]),
Section(name: "iPad", items: ["iPad Pro", "iPad Air 2"]),
Section(name: "iPhone", items: ["iPhone 7", "iPhone 6"])
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment