Parsing JSONArray to string array using SwiftyJSON
<p>Well I am really new Swift and I've used swiftyJSON to have an ease in parsing JSON data coming from the API.</p>

<p>I have a data response which looks like this:</p>

<pre><code>[
   {
     "fname": &lt; String value&gt;
     "mname": &lt; String value&gt;
     "lname": &lt; String value&gt;
     "weights": [
          {
            "date": &lt;String value&gt;, 
            "weight": &lt;String value&gt; 
          },
          {
            "date": &lt;String value&gt;,
            "weight": &lt;String value&gt;
          }
]
</code></pre>

<p>For my swiftyJSON parsing way, here is my code</p>

<pre><code>let swiftyJSON = JSON(data: data!)
for item in swiftyJSON.arrayValue{
    self.firstName = item["fname"].stringValue
    self.middleName = item["mname"].stringValue
    self.lastName = item["lname"].stringValue
    //JSON Array "weights" code snippet below
}
</code></pre>

<p>For the names I've parsed it to string but with the <code>"weights"</code>. I have no idea how to do that. I've tried it using this:</p>

<pre><code>for key in item["weights"]["weight"].arrayValue{
   self.allWeights.append(key.stringValue)
}
</code></pre>

<p>And it is not working. Can someone help me with this? thanks a lot.</p>