title: Stop unwanted flash animation on UICollectionViewCell after calling view.layoutIfNeeded
body: <p>I've a chat screen built with UICollectionView and there's a bottom container view that contains the textview and some buttons</p>
  
  <p>When I update the bottom constraint of the container view and call layoutIfNeeded it results into a weird "flashing" animation on the cells.</p>
  
  <p>On willDisplayCell I've done this</p>
  
  <pre class="lang-swift prettyprint-override"><code>UIView.performWithoutAnimation {
      cell.layoutIfNeeded()
  }
  </code></pre>
  
  <p>But it looks like it's affecting nothing.</p>
  
  <p>I use Typist to handle the keyboard and that's how I animate my constraints</p>
  
  <pre class="lang-swift prettyprint-override"><code>        keyboard
              .toolbar(scrollView: mainView.chatCollectionView)
              .on(event: .willChangeFrame) { [weak self] options in
                  guard let self = self else { return }
                  guard self.mainView.sendMessageTextView.isFirstResponder else { return }
                  let height = options.endFrame.height
                  self.mainView.bottomContainerViewBottomConstraint.constant = -max(0, height - self.view.safeAreaInsets.bottom)
                  UIView.animate(withDuration: 0, delay: 0, options: .curveEaseIn, animations: {
                      self.mainView.layoutIfNeeded()
                  }, completion: { _ in })
              }
              .on(event: .willHide) { [weak self] options in
                  guard let self = self else { return }
                  self.mainView.bottomContainerViewBottomConstraint.constant = 0
                  UIView.animate(withDuration: 0, delay: 0, options: .curveEaseIn, animations: {
                      self.mainView.layoutIfNeeded()
                  }, completion: { _ in })
              }
              .start()
  </code></pre>
  
  <p>Also reverting to default keyboard listeners via NotificationCenter did nothing so I don't suspect the library is the problem.</p>
  
  <p>As you can see on this video the cells are kind of "flashing" is there anyway to stop that flashing from happening ?</p>
  
  <p><a href="https://www.youtube.com/watch?v=sjZ62df5i2w" rel="nofollow noreferrer">https://www.youtube.com/watch?v=sjZ62df5i2w</a></p>