title: Swift - ReloadData not update
body: <p>I'm trying to fill CollectionView in Swift with data from a Json Structure but I'm not able to reload the array and parse into the collectionView
  I'm declaring an Array(V_textoturismo) and I parse the content of JSON to it, but seems that is not able or when it passes I can't reload the collection view.
  If I made it with an static Array(texto) I can't do it without a problem
  Thanks 4 everything
  I Attach my code:</p>
  <pre><code>import UIKit
  
  struct category: Codable {
             let textoturismo: String
             let imagenturismo: String
             let destinoturismo: String
  }
  struct Entry_category: Codable {
             let categories: [String: category]
  }
  
  class CollectionViewController: UIViewController, UICollectionViewDelegate, UICollectionViewDataSource {
      
      @IBOutlet weak var collectionView: UICollectionView!
      @IBOutlet var menuButton:UIBarButtonItem!
      
      var v_textoturismo:[String] = []
      var v_imagenturismo:[String] = []
      var v_destinoturismo:[String] = []
      
      let imagen = [&quot;Perdidos&quot;, &quot;Friends&quot;, &quot;Breaking Bad&quot;, &quot;Dexter&quot;]
      let texto = [NSLocalizedString(&quot;Hotels&quot;, comment: &quot;&quot;),
                          NSLocalizedString(&quot;Restaurants&quot;, comment: &quot;&quot;),
                          NSLocalizedString(&quot;Bars&amp;Pubs&quot;, comment: &quot;&quot;),
                          NSLocalizedString(&quot;Discoteques&quot;, comment: &quot;&quot;)]
  
      override func viewDidLoad() {
          super.viewDidLoad()
          //collectionView?.dataSource = self;
          //collectionView?.delegate = self;
          
          if self.revealViewController() != nil {
              menuButton.target = self.revealViewController()
              menuButton.action = #selector(SWRevealViewController.revealToggle(_:))
              self.view.addGestureRecognizer(self.revealViewController().panGestureRecognizer())
          }
          if let layout = collectionView?.collectionViewLayout as? UICollectionViewFlowLayout{
              //layout.minimumLineSpacing = 10
              //layout.minimumInteritemSpacing = 10
              //layout.sectionInset = UIEdgeInsets(top: 0, left: 5, bottom: 0, right: 0)
              //let size = CGSize(width:(collectionView!.bounds.width)/2, height: 150)
              let size = CGSize(width:(collectionView!.frame.size.width)/2, height: 150)
              layout.itemSize = size
          }
      }
  
      override func didReceiveMemoryWarning() {
          super.didReceiveMemoryWarning()
          
      }
      
      func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -&gt; Int {
          return v_textoturismo.count
      }
      
      func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -&gt; UICollectionViewCell {
          let identifier = &quot;Item&quot;
          let cell = collectionView.dequeueReusableCell(withReuseIdentifier: identifier, for: indexPath) as! SeriesCollectionViewCell
          //cell.itemLabel.text = texto[indexPath.row]
          cell.itemLabel.text = v_textoturismo[indexPath.row]
          cell.itemImage.image = UIImage.init(imageLiteralResourceName: imagen[indexPath.row])
          return cell
      }
      
      override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
          let item = sender as? UICollectionViewCell
          let indexPath = collectionView.indexPath(for: item!)
          let detailVC = segue.destination as! DetailViewController
          detailVC.detailName = imagen[(indexPath?.row)!]
      }
      
      func parseCategories(){
          //Leo JSON categorias
                 
                 NSLog(&quot;entro&quot;)
                 if let url2 = URL(string: &quot;http://s369243288.mialojamiento.es/WS_CB_Addicts/categorias_turismo/json_data.php&quot;) {
                    URLSession.shared.dataTask(with: url2) { data, response, error in
                       if let data = data {
                       let jsonDecoder = JSONDecoder()
                       do {
                       let parsedJSON = try jsonDecoder.decode(Entry_category.self, from: data)
                       for category in parsedJSON.categories {
                         self.v_textoturismo.append(category.value.textoturismo)
                         print(category.value.textoturismo)
                         self.v_imagenturismo.append(category.value.imagenturismo)
                         self.v_destinoturismo.append(category.value.destinoturismo)
                         print(category.value.destinoturismo)
                       //print(image.value.destino)
                                   }
                               } catch {
                       print(error)
                               }
                              }
                          }.resume()
                 }
                 //End Leo JSON categorias
      }
      
      override func viewWillAppear(_ animated: Bool) {
            //super.viewWillAppear(animated)
            parseCategories()
            //self.collectionView.reloadData()
          DispatchQueue.main.async {
              self.collectionView.reloadData()
          }
          print(v_textoturismo)
        }
  }
  </code></pre>