title: Parse Nested Array in JSON in Swift
body: <p>I'm trying to Parse JSON with code and structure like this: </p>
  
  <pre><code>    userApiService.getAllUsers { (responseDict:NSDictionary?, error:NSError?) -&gt; Void in
     //Parse responseDict for the key "result"
  
        }
  </code></pre>
  
  <p>Here is Json Structure </p>
  
  <pre><code>   {
          error = "";
          result =     (
                      {
                  name = AnotherUser;
                  password = AnotherPassword;
                  userId = 1343;
              },
                      {
                  name = TestUser;
                  password = TestPassword;
                  userId = 1344;
              },
                      {
                  name = TestUser;
                  password = TestPassword;
                  userId = 1347;
              },
          );
          status = 200;
      }
  </code></pre>
  
  <p>I've tried code like this: </p>
  
  <pre><code> self.loadingIcon.endRefreshing()
              if let resultDict = responseDict["result"] as? NSArray {
                  for userRecord in resultDict{
                      var userModel = User(userDict: userRecord as! NSDictionary)
                      self.tableData.append(userModel)
                  }
              }
              self.tblView.reloadData()
          }
  </code></pre>
  
  <p>But this results in the error <code>"NSArray?" is not convertible to StringLiteralConvertible</code> If I remove the optional and add the ! force unwrap to the closure signature then this error goes away. However, I've seen instances where my app was crashing if something wrong came from the backend. So my questions are: </p>
  
  <ol>
  <li><p>Is there a way to parse this JSON and still keep the optional NSDictionary in the closure signature.</p></li>
  <li><p>Or do I just need to check if the dictionary is not nil and then proceed with the code I posted above?</p></li>
  </ol>