title: swift: animation with buttons
body: <p>I use this code to create animation with button:</p>
  
  <pre><code>func collectionView(_ collectionView: UICollectionView, willDisplay cell: UICollectionViewCell, forItemAt indexPath: IndexPath) {
  
      switch indexPath.section {
      case 0:
          self.button1.constant = self.button2.constant
      case 6:
          self.button3.constant = self.button4.constant
      default:
          self.button1.constant = 0
          self.button3.constant = 0
      }
  
      UIView.animate(withDuration: 1.0, delay: 0.0,
                     options: [], animations: {
                      self.view.layoutIfNeeded()
      })
  }
  </code></pre>
  
  <p>I have <code>collectionView</code>. But with my buttons my <code>collectionView</code> animated too. How to do that I have animation only with button?</p>
  
  <p>This code doesn't work:</p>
  
  <pre><code>UIView.animate(withDuration: 1.0, delay: 0.0,
                 options: [], animations: {
                  self.myButton.layoutIfNeeded()
                  self.myButton1.layoutIfNeeded()
  })
  </code></pre>