title: How to get specific value from JSON and display it's elements on CollectionView?
body: <p>Is it possible to get specific elements from JSON and display it's other elements on collectionView?</p>
  
  <p><strong>Broader question:</strong>
  This is my JSON object:</p>
  
  <pre><code>{
      "id": 1,
      "floor": 1,
      "full_name": "Ernst &amp; Young Audit LLC",
      "description": "Ernst &amp; Young («Эрнст энд Янг», в наст. время — EY) — британская аудиторско-консалтинговая компания, одна из крупнейших в мире. Основана в 1989 путём слияния американских аудиторских компаний A. C. Young, основанной Артуром Янгом в 1906 году, и Ernst &amp; Whinney, основанной Элвином Эрнстом в 1903 году.\r\n\r\nПодробнее: http://www.ey.com/",
      "logo_url": "http://########/EY_logo13.png"
  }
  </code></pre>
  
  <p>Here, I want to get <code>full_name</code>, <code>description</code> and <code>logo_url</code> referring to <code>floor</code> which is an Integer that has values of 2,3,4,5. </p>
  
  <p>For example: </p>
  
  <p>if the <code>floor</code> is 1, I want to get values from the floor 1, if it is 2 then get values from second floor and so on. Next, display it on my CollectionView. But my code doesn't show anything. Any help would be appreciated!!</p>
  
  <p>This is what I have done so far:</p>
  
  <pre><code>var companies = [Employer]()
  var companiesByFloor: [Int : [Employer]] = [:]
  
  override func viewDidLoad() {
      super.viewDidLoad()
      navigationItem.title = "Карта"
  
      getEmployerData {
          self.employerCollectionView.reloadData()
      }
      floorCollectionView.reloadData()
  
      scrollView.minimumZoomScale = 1.0
      scrollView.maximumZoomScale = 5.0
  }
  
  func viewForZooming(in scrollView: UIScrollView) -&gt; UIView? {
      return mapImage
  }
  
  func getEmployerData(completed: @escaping () -&gt; ()) {
      let url = URL(string: "http://######/employer/")
      Alamofire.request(url!).responseJSON { response in
          let data = response.data
          do {
              self.companies = try JSONDecoder().decode([Employer].self, from: data!)
  
              for item in self.companies {
                  let arr = Employer(floor: item.floor, full_name: item.full_name, description: item.description, logo_url: item.logo_url)
                  self.companiesByFloor[item.floor] = [arr]
              }
              DispatchQueue.main.async {
                  completed()
              }
          }
          catch let e{
              print(e)
          }
      }
    }
  }
  </code></pre>
  
  <p><strong>CollectionView</strong></p>
  
  <pre><code>func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -&gt; Int {
    return companiesByFloor[selectedFloor]!.count
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/BtvZc.png" rel="nofollow noreferrer">Screenshot of Collection View</a></p>