6

I have created an app which I used the JSQMessageViewController and it works fine in iOS 8. I used Swift in this project and I do bridging since the library is written in Objective-C. But after the released of iOS 9, Xcode 7, and Swift 2, I converted my code syntax to Swift 2 and the problems comes.. The app was not crashed but there is a log error… See below.

2015-09-23 14:45:08.867 COC REAL WAR[1201:546997] Logging only once for UICollectionViewFlowLayout cache mismatched frame  
2015-09-23 14:45:08.868 COC REAL WAR[1201:546997] UICollectionViewFlowLayout has cached frame mismatch for index path <NSIndexPath: 0xc000000000a00016> {length = 2, path = 0 - 5} - cached value: {{4, 693.221}, {312, 97}}; expected value: {{4, 596}, {312, 97}}  
2015-09-23 14:45:08.868 COC REAL WAR[1201:546997] This is likely occurring because the flow layout subclass JSQMessagesCollectionViewFlowLayout is modifying attributes returned by UICollectionViewFlowLayout without copying them

Answers are much appreciated.

Ajith Renjala
  • 4,934
  • 5
  • 34
  • 42
user2749248
  • 676
  • 1
  • 7
  • 15
  • 2
    While the current answer may solve your problem,it is not what needs to be done, xcode is telling you that you are returning new attributes while you should return the attributes from the superclass, changing some of them if needed. Could you post your `layoutAttributesForElementsInRect`? I can point you to your mistake. – vrwim Jan 15 '16 at 11:24
  • This was answered here [link](https://stackoverflow.com/a/43106089/12039062). This is a duplicate. – carlosobedgomez Mar 26 '20 at 00:27

1 Answers1

3

I don't know if this was the right answer but just found an answer from link. I'm just changing the springinessEnabled to false..

collectionView!.collectionViewLayout.springinessEnabled = false

user2749248
  • 676
  • 1
  • 7
  • 15
  • This worked for me!! I was getting a full on crash too. Plus it runs much better without the springyness. – Smikey Sep 25 '15 at 14:44
  • It's your question, so you have to vote it as the answer. I've already up voted it. – Smikey Nov 11 '15 at 23:45