I'm completely stuck. I'm working on building an iOS app in Swift. I need to define an array of tools within a struct, but if I include any more than 4 items Xcode gets stuck indexing.
Found the solution to that particular issue here: https://stackoverflow.com/a/27531394. I can't figure out how to append to the array, however. When I attempt to do the code below, I get the following error: "Expected declaration". Any ideas?
import Foundation
struct Toolkit {
var tools = [ [
"name": "Know Yourself to Lead Yourself",
"shape": "icon_knowyourself.pdf",
"image": "know_yourself_to_lead_yourself.pdf",
"backgroundColor": ["red": 215, "green": 34, "blue": 14, "alpha": 1.0]
],
[
"name": "The Core",
"shape": "icon_thecore.pdf",
"image": "the_core.pdf",
"backgroundColor": ["red": 185, "green": 34, "blue": 14, "alpha": 1.0]
],
[
"name": "5 Circles of Influence",
"shape": "icon_5circles.pdf",
"image": "5_circles_of_influence.pdf",
"backgroundColor": ["red": 185, "green": 34, "blue": 14, "alpha": 1.0]
],
[
"name": "Support Challenge Matrix",
"shape": "icon_supportchallenge.pdf",
"image": "support_challenge_matrix.pdf",
"backgroundColor": ["red": 205, "green": 34, "blue": 14, "alpha": 1.0]
]
]
tools.append([
"name": "Creating Healthy Culture",
"shape": "icon_healthyculture.pdf",
"image": "creating_healthy_culture.pdf",
"backgroundColor": ["red": 185, "green": 34, "blue": 14, "alpha": 1.0]
])
}