I'm trying to use NYTPhotoViewer to open a message from JSQMessagesViewController. After much research, I feel like I have the code correct, but continue to get the error "unrecognized selector sent to instance". Here is the code:
override func collectionView(collectionView: JSQMessagesCollectionView, didTapMessageBubbleAtIndexPath indexPath: NSIndexPath!) {
super.collectionView(collectionView, didTapMessageBubbleAtIndexPath: indexPath)
var photos = [UIImage]()
if messages[indexPath.item].isMediaMessage {
let mediaItem: JSQMessageMediaData = messages[indexPath.item].media
let photoItem: JSQPhotoMediaItem = mediaItem as! JSQPhotoMediaItem
let image: UIImage = photoItem.image
photos.append(image)
}
let photosViewController: NYTPhotosViewController = NYTPhotosViewController(photos: photos)
presentViewController(photosViewController, animated: true, completion: nil)
}
Any help would be greatly appreciated!!
Thanks