How to use JSONSerialization.jsonObject with jagged array (json data) from php in SWIFT 3
<p>So I have a JSON data returning from a php file:</p>

<pre><code>{"is_success":1,"message":"Has sync","data":[{"id":"7","customer_id":"007"}]}
</code></pre>

<p>And I have a swift code:</p>

<pre><code>if var myJSON = try JSONSerialization.jsonObject(with: data!, options: .mutableContainers) as? [NSDictionary]
{
            for jsonDict in myJSON
            {
                 var try: String = (jsonDict["customer_id"] as? String)!
            }
}
</code></pre>

<p>Apparently, it won't go inside the if statement because of the <code>[NSDictionary]</code>. I tried <code>[String: AnyObject]</code>, <code>[NSDictionary]</code>, and etc from other guides and it just won't work. Any suggestions to replace the <code>[NSDictionary]</code>? Thanks!</p>