4

I'm currently coding an iOS app in Swift, and I use some stuff like JSQMessages and JSQSystemSoundPlayer in Objective C.

When I introduced them in my code, I had the Xcode 6.2, and it worked perfectly. I downloaded Xcode 6.3.4 to use Swift 1.2, but now I have 40 warnings like :

"Property type "JSQMessagesCollectionView" is incompatible with type "UICollectionView", inherited from "UICollectionViewLayout""

I already made a Bridging Header to call the Objective C files.

Thanks a lot

Léo Natan
  • 56,823
  • 9
  • 150
  • 195
alexandresecanove
  • 5,725
  • 4
  • 15
  • 14
  • This is not the place for such a question. You should open an issue with the GitHub tracker for this project: https://github.com/jessesquires/JSQMessagesViewController – Léo Natan Apr 07 '15 at 17:46
  • This is not a problem related to JSQMessages I would like to know, just what does mean this error (it could be my own code, it worked for Xcode 6.2, but not in Xcode 6.3.4), thanks Leo – alexandresecanove Apr 07 '15 at 17:50
  • I removed the downvote. I thought you were complaining about the warning, instead of looking to learn about it, sorry about that. See my answer. – Léo Natan Apr 07 '15 at 18:02
  • Please answer this question if anyone knows that issue http://stackoverflow.com/questions/31153071/jsqmessagesviewcontroller-in-swift-with-xcode-6-3-objective-c-selector-issue – Muhammad Raza Jul 01 '15 at 05:30

2 Answers2

3

Following the comments, here is the explanation of what this warning is.

Xcode 6.3 has an updated compiler toolchain, which is more strict, thus you are seeing more warnings in general, including this one.

Here, the class JSQMessagesCollectionViewFlowLayout declares a property whose definition conflicts with its superclass' definition:

@property (readonly, nonatomic) JSQMessagesCollectionView *collectionView;

Whereas, in the superclass, UICollectionViewLayout, it is declared as:

@property(nonatomic, readonly) UICollectionView *collectionView;

Objective C does not support property covariance, and this override is an incorrect use of the language by Jesse. The JSQMessagesCollectionViewFlowLayout class should expose an additional property which is of the subclass type.

Léo Natan
  • 56,823
  • 9
  • 150
  • 195
0

in order to remove this warning, just remove @property (readonly, nonatomic) JSQMessagesCollectionView *collectionView; from its class JSQMessagesCollectionViewFlowLayout.h to JSQMessagesCollectionViewFlowLayout.m

James A Mohler
  • 11,060
  • 15
  • 46
  • 72
Xin Lok
  • 496
  • 1
  • 6
  • 21