title: iOS13 Context Menu How to show or navigate to the current peeking view when tapping on it
body: <p>I'm trying to implement "Context Menu" in iOS13 in a table view (tried collection view as well, they have same issue):</p>
  
  <p>I followed the instruction <a href="https://kylebashour.com/posts/ios-13-context-menus" rel="noreferrer">here</a> , created a collection view with bunch of photos, and when 3d touch, I will get a preview with an action list, like this:</p>
  
  <p><a href="https://i.stack.imgur.com/ybW1k.jpg" rel="noreferrer">Peek and Menu View</a></p>
  
  <p><a href="https://i.stack.imgur.com/eBIHi.jpg" rel="noreferrer">Collection View</a></p>
  
  <p>The delegate method in UITableView:</p>
  
  <pre><code>- (void)tableView:(UITableView *)tableView willCommitMenuWithAnimator:
  (id&lt;UIContextMenuInteractionCommitAnimating&gt;)animator;
  </code></pre>
  
  <p>and in collectionView</p>
  
  <pre><code>- (void)collectionView:(UICollectionView *)collectionView willCommitMenuWithAnimator:
  (id&lt;UIContextMenuInteractionCommitAnimating&gt;)animator;
  </code></pre>
  
  <p>both don't have "<code>indexPath</code>";</p>
  
  <p>So there is no way for me to pass in the current cell or index I'm peeking. </p>
  
  <p>I want to implement this delegate method so when I tap on the preview image, it will navigate to the expected page with information that's bounded to the current cell.</p>
  
  <p>What I want and tried is something like this:</p>
  
  <pre><code>func collectionView(_ collectionView: UICollectionView, willCommitMenuWithAnimator animator: UIContextMenuInteractionCommitAnimating) {
      animator.addAnimations {
          self.show(PreviewViewController(image: UIImage(named: "indexpathString")), sender: self)
      }
  }
  </code></pre>
  
  <p>and the <code>indexpathString</code> is related to the current selected cell or collection so I can init the viewController based on it. </p>
  
  <p>Please let me know if there is any other way to do this.</p>