File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
ChatSecure/Classes/View Controllers Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -2001,8 +2001,17 @@ - (void)collectionView:(JSQMessagesCollectionView *)collectionView didTapMessage
20012001 [alert addAction: obj];
20022002 }];
20032003 [alert addAction: [self cancleAction ]];
2004+
2005+ // Get the anchor
20042006 alert.popoverPresentationController .sourceView = self.view ;
20052007 alert.popoverPresentationController .sourceRect = self.view .bounds ;
2008+ UICollectionViewCell *cell = [collectionView cellForItemAtIndexPath: indexPath];
2009+ if ([cell isKindOfClass: [JSQMessagesCollectionViewCell class ]]) {
2010+ UIView *cellContainterView = ((JSQMessagesCollectionViewCell *)cell).messageBubbleContainerView ;
2011+ alert.popoverPresentationController .sourceRect = cellContainterView.bounds ;
2012+ alert.popoverPresentationController .sourceView = cellContainterView;
2013+ }
2014+
20062015 [self presentViewController: alert animated: YES completion: nil ];
20072016 }
20082017}
You can’t perform that action at this time.
0 commit comments