I can't figure out if this is even possible in Swift, but using a for index loop I'm trying to match the index of my array with a property located within a structure within myarray
Data:
class MyClass {
struct myStruct {
var name: String? = ""
var age: Double = 0
}
let myArray: [myStruct] = [
myStruct(name: "Gary", age: 35),
myStruct(name: "Carol", age: 60),
myStruct(name: "Lou", age: 55)
]
}
Controller:
var instanceofMyClass = MyClass()
for (index, age) in enumerate(instanceofMyClass.myArray) {
println("my index is \(index) and age is \(age)")
When I substitute my array of structs with a simple array of strings, I return a value, but cannot return a value when it's an array of structs