Using the JSQMessage podfile for iOS, in this method;
collectionView:(JSQMessagesCollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { .. }
How do I set the it to use JSQMessagesCollectionViewCellIncoming
or JSQMessagesCollectionViewCellOutgoing
? I am finding it diffcult to find examples of how other apps do this
My code;
- (UICollectionViewCell *)collectionView:(JSQMessagesCollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
JSQMessagesCollectionViewCell *cell = (JSQMessagesCollectionViewCell*)[super collectionView:collectionView cellForItemAtIndexPath:indexPath];
[cell.textView setDataDetectorTypes:UIDataDetectorTypeNone];
cell.textView.text = nil;
VICChatMessage <JSQMessageData> *messageData = (VICChatMessage*)[collectionView.dataSource collectionView:collectionView messageDataForItemAtIndexPath:indexPath];
cell.textView.attributedText = messageData.attributedText;
return cell;
}