title: JSQMessagesViewcontroller custom JSQMediaItem
body: <p>I'm using JSQMessagesViewController and I write my custom photo and voice MediaItems which inheritance JSQMediaItem, and the mediaView of these two message types are different.
  Everything goes fine when sending/receiving these two kind of messages, but when I use a loop to load some historical messages, it appears incorrectly.</p>
  
  <p><a href="https://i.stack.imgur.com/FBAAG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FBAAG.png" alt="screenShot1"></a></p>
  
  <p>It seems that all the mediaMessage reused the first mediaMessage's cell size.
  But when I send photo/voice messages then, the newly send message appears correctly.</p>
  
  <p><a href="https://i.stack.imgur.com/NG7cf.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NG7cf.jpg" alt="screenShot2"></a></p>
  
  <p>my cellForItemAtIndexPath method is as follow:</p>
  
  <pre><code>override func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -&gt; UICollectionViewCell {
      let cell = super.collectionView(collectionView, cellForItemAtIndexPath: indexPath)
      return cell
  }
  </code></pre>
  
  <p>The message loading code:</p>
  
  <pre><code>for msg in msgs {
      let jsqMessage = self.genJSQMessage(msg)
      self.messages.append(jsqMessage)
      self.finishSendingMessageAnimated(true)
  }
  </code></pre>
  
  <p>I am really confused, any advice and suggestions will be greatly appreciated!</p>