title: UICollectionViewCell flip animation
body: <p>I want to have a flip animation with my cells when the user touches them. When the cell is flipped, the backside should show another image.</p>
  
  <p>I have solved it by putting a coverimage above my cell content that will be hidden or not.</p>
  
  <p>How can I force a cell to do the flip animation? I could only make it working with a reload of the cell, but this has sideeffects.</p>
  
  <p>How can I force a flip animation and change the state of the cell when it is turned by 180 degrees?</p>
  
  <p>Here is the code inside my UICollectionViewCell that contains the animation:</p>
  
  <pre><code>func makeImageVisible(visible:Bool, animated: Bool){
  
          if(animated){
              UIView.transitionWithView(self.contentView, duration: 0.5, options: UIViewAnimationOptions.TransitionFlipFromLeft, animations: { () -&gt; Void in
                      self.coverImageView.hidden = visible
              }, completion: nil)
          }
          else{
              self.coverImageView.hidden = visible
          }
      }
  </code></pre>
  
  <p>The cell contains some views that are covered by the coverimage. Depending on the state the coverimage is hidden or not.</p>
  
  <p>And here is my cellForIndexPath-method:</p>
  
  <pre><code>func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -&gt; UICollectionViewCell {
  
      let cell = collectionView.dequeueReusableCellWithReuseIdentifier("MemoryGameCell", forIndexPath: indexPath) as! MemoryGameCell
  
      cell.setImage(self.image!)
      cell.makeImageVisibile(self.imageIsVisible(indexPath), animated: self.imageIsTemporaryVisible(indexPath))
  
      return cell
  }
  </code></pre>
  
  <p>If a cell gets touched I put it in the visiblecells-array and reload the collectionview. I tried it without reloading the collectionview by calling makeImageVisible directly, but then nothing happens.
  Any ideas what could be the problem?</p>