title: Problem with mapping an array of objects in Swift
body: <p>I have the following 2 class / structs:</p>
  
  <pre class="lang-swift prettyprint-override"><code>class ConversationDetails {
  
      var messages: [ChatMessage]?
      var participants: [User]?
  }
  
  class User: Codable {
  
      init (email: String) {
          self.email = email
      }
  
      // system
      var id: String?
      var verifiedaccount: Int?
      var rejected: Int?
      ...
  }
  </code></pre>
  
  <p>I've further got the <code>var conversationDetails = ConversationDetails ()</code> and I'm populating it with an API call. That all works fine.</p>
  
  <p>I'd like to map the participants array in<code>conversationDetails</code>and access the id property of each participant like so:</p>
  
  <pre class="lang-swift prettyprint-override"><code>let recipient_ids = self.conversationDetails.participants.map( { (participant) -&gt; String in
             return participant.id
          })
  </code></pre>
  
  <p>In my understanding, map iterates over the entire participants array, which is an array of User objects and I can access each item via <code>participant</code>.
  However, I get <code>Value of type '[User]' has no member 'id'</code> for <code>return participant.id</code>.</p>
  
  <p>Where is my misunderstanding?</p>