title: Accessing index # of an array of structures in Swift
body: <p>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</p>
  
  <p>Data: </p>
  
  <pre><code>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)
      ]
  }
  </code></pre>
  
  <p>Controller: </p>
  
  <pre><code>var instanceofMyClass = MyClass()
  
  for (index, age) in enumerate(instanceofMyClass.myArray) {
      println("my index is \(index) and age is \(age)")
  </code></pre>
  
  <p>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</p>