In this method, change the color of the incoming text or outgoing text
override func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
let cell : JSQMessagesCollectionViewCell = super.collectionView(collectionView, cellForItemAtIndexPath: indexPath) as! JSQMessagesCollectionViewCell
let msg : JSQMessage = (self.demoData?.messages[indexPath.row])! as! JSQMessage
if (!msg.isMediaMessage) {
if(msg.senderId == self.senderId())
{
cell.textView?.textColor = UIColor.blackColor()
}else
{
cell.textView?.textColor = UIColor.whiteColor()
}
cell.textView?.linkTextAttributes = [NSForegroundColorAttributeName : UIColor.blueColor()]
}
return cell;
}
with this code you can change the color of links
cell.textView?.linkTextAttributes = [NSForegroundColorAttributeName : UIColor.blueColor()]
Hope this helps you.
source
share