title: Swift - Select first item from the collection view programmatically
body: <p>I have a problem calling the selectItem method for collection view.
  Images from Firebase Storage are loaded into the collection view. After loading the first image I want to invoke programmatically click on the first image.
  I tried</p>
  
  <pre><code>  self.collectionView.selectItem(at: IndexPath(item: 1, section: 0), animated: false, scrollPosition: UICollectionView.ScrollPosition.centeredHorizontally)
  </code></pre>
  
  <p>But it doesn't work.
  The didSelectItemAt method works correctly when I manually click on the collection view element.</p>
  
  <p>How can I solve my problem?</p>