Skip to content

Instantly share code, notes, and snippets.

@fongd
Created June 29, 2016 20:51
Show Gist options
  • Save fongd/a50af714c1df4d9a3fe3a168bb094960 to your computer and use it in GitHub Desktop.
Save fongd/a50af714c1df4d9a3fe3a168bb094960 to your computer and use it in GitHub Desktop.
// set up the data that will be displayed in the info table
let info = [
"sumLengthKm": "Length",
"trailType": "Trail Type",
"activities": "Activities",
"environment": "Environment",
"resources": "Other Resources"
]
for (key, value) in info {
let data = NSDictionary()
let headerLabel: String! = value
var content: String!
if key == "resources" {
// for resources, we need to collect the values of websiteurl[1-4] and
// groupname[1-4] for display
} else {
content = trailSegment?.valueForKey(key) as? String
}
data.setValue(headerLabel, forKey: "headerLabel")
data.setValue(content, forKey: "content")
infoTableData.append(data)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment