title: how can I parse a multidimensional array into UITableview with sections
body: <p>I have a remote db call delivering a list of items that looks something like this</p>
  <pre><code>{
     &quot;result&quot;:[
        {
           &quot;Section&quot;:&quot;Client&quot;,
           &quot;result&quot;:[
              {
                 &quot;Owner&quot;:&quot;Client Owned&quot;,
                 &quot;Barcode&quot;:&quot;10000473&quot;,
                 &quot;Quantity&quot;:&quot;5&quot;,
                 &quot;Description&quot;:&quot;Large Dog&quot;,
                 &quot;Status&quot;:&quot;ok&quot;
              },
              {
                 &quot;Owner&quot;:&quot;Client Owned&quot;,
                 &quot;Barcode&quot;:&quot;10000439&quot;,
                 &quot;Quantity&quot;:&quot;1&quot;,
                 &quot;Description&quot;:&quot;Privacy Wall Panels - 4ft Green Countertop 4CT-G&quot;,
                 &quot;Status&quot;:&quot;missing&quot;
              }
           ]
        },
        {
           &quot;Section&quot;:&quot;Rental&quot;,
           &quot;result&quot;:[
              {
                 &quot;Owner&quot;:&quot;Rental&quot;,
                 &quot;Barcode&quot;:&quot;10000006&quot;,
                 &quot;Quantity&quot;:&quot;1&quot;,
                 &quot;Description&quot;:&quot;2X2. X42 BLK CABINET &quot;,
                 &quot;Status&quot;:&quot;missing&quot;
              },
              {
                 &quot;Owner&quot;:&quot;Rental&quot;,
                 &quot;Barcode&quot;:&quot;10000007&quot;,
                 &quot;Quantity&quot;:&quot;2&quot;,
                 &quot;Description&quot;:&quot;TALL BLK TABLETOP BASE&quot;,
                 &quot;Status&quot;:&quot;missing&quot;
              },
              {
                 &quot;Owner&quot;:&quot;Rental&quot;,
                 &quot;Barcode&quot;:&quot;10000005&quot;,
                 &quot;Quantity&quot;:&quot;1&quot;,
                 &quot;Description&quot;:&quot;TALL BLK TABLETOP BASE&quot;,
                 &quot;Status&quot;:&quot;missing&quot;
              },
              {
                 &quot;Owner&quot;:&quot;Rental&quot;,
                 &quot;Barcode&quot;:&quot;&quot;,
                 &quot;Quantity&quot;:&quot;3&quot;,
                 &quot;Description&quot;:&quot;Asbestos Board&quot;,
                 &quot;Status&quot;:&quot;missing&quot;
              }
           ]
        }
     ]
  }
  </code></pre>
  <p>I want to parse it into a UITableview with 2 sections, Rental and Client. My current struct setup is not working.</p>
  <pre><code>struct ReceiveIn: Codable {  
     var Section: String  
     var result: [Components]    
  }
  
  struct Components: Codable {
      var Owner: String
      var Barcode: String
      var Quantity: String
      var Description: String
      var Status: String
  }
  </code></pre>
  <p>I would like to parse the db data into a tableview with two sections: client and rental, which is determined by the array I'm currently sending with the api, OR I could use the Owner var in the component.  Whichever is easier.  Not sure how to change my structs to make either work so any help appreciated.</p>
  <p>Decoding code below</p>
  <pre><code>func parse(_ data: Data){
      
      let decoder = JSONDecoder()
      
      if let jsonUnits = try? decoder.decode(ReceiveIn.self, from: data) {
          ReviewList = jsonUnits.result
          
          DispatchQueue.main.async {
              self.tableView.reloadData()
          }
      }
  }
  </code></pre>