title: Swift passing array values from one viewcontroller to another
body: <p>My Scenario, I am loading <code>JSON</code> data into <code>tableView</code>, whenever I am trying to click <code>tableView</code> custom <code>cell</code> I am getting cell <code>indexPath.row</code> data. Now, I am trying to pass particular cell <code>array</code> data to another <code>viewcontroller</code>. Here, I need to <code>verify</code> below code is correct one or not and also how to get all the <code>values</code> from array and to show on <code>labels</code> in second <code>viewcontroller</code>?</p>
  
  <p>Here below code to passing array value one to another viewcontroller </p>
  
  <pre><code>override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
      print(self.tableArray[indexPath.row])
      tableView.deselectRow(at: indexPath, animated: true)
  
      let smallVC = storyboard!.instantiateViewController(withIdentifier: "popupview")  as! PopupViewController
      let item = tableArray[indexPath.row]
      smallVC.array = [item]
      present(smallVC, animated: true, completion: nil)
  }
  </code></pre>
  
  <p>Second ViewController </p>
  
  <pre><code>var array = [Datum]() //Datum decodable root
  
  override func viewDidLoad() {
      super.viewDidLoad()
      print(“DATA: \(array)") //here, i need to get all values and assign label.
  }
  </code></pre>
  
  <p>My Output </p>
  
  <blockquote>
    <p>DATA: [parseJSON.Datum(catID: "3", catName: "Cars", catParentid: "2",
    name: “jhon”, year: "3000", fullname: parseJSON.Fullname(firstname:
    "jio", lastname: "jack"), address: parseJSON.Address(city:
    "sanfrancisco", state: "california"), ship: parseJSON.Ship(captian:
    "mojo", time: "12.30.01"))]</p>
  </blockquote>