title: Selecting UICollectionViewCell in the presence of UITapGestureRecognizer
body: <p>I am trying to respond to <code>UICollectionViewCell</code> selection:</p>
  
  <pre><code>private func setupCellAction() {
      collectionView?.rx.itemSelected
          .asObservable()
          .subscribe(onNext: { [weak self] indexPath in
              print("itemSelected!")
              let cell = self?.collectionView?.cellForItem(at: indexPath) as? CellTypeCollectionViewCell
              self?.performSegue(withIdentifier: "showBarchartSegue", sender: cell)
          }).disposed(by: disposeBag)
  }
  </code></pre>
  
  <p>But somehow <code>onNext</code> method is never called. I tried putting <code>setupCellAction()</code> in <code>viewDidLoad</code>, <code>viewWillAppear</code> and <code>viewDidAppear</code> but it is not working. Any suggestions would be greatly appreciated.</p>
  
  <blockquote>
    <p>Update</p>
  </blockquote>
  
  <p>I tried the suggestion from the following thread: <a href="https://stackoverflow.com/questions/43323645/how-to-select-collectionview-cell-in-rxswift">How to select CollectionView cell in RxSwift</a></p>
  
  <p>and added <code>.debug("RX: Model selected")</code> before the <code>subscribe</code> method. I see the output in the console that it is subscribed once.</p>
  
  <blockquote>
    <p>Update</p>
  </blockquote>
  
  <p>I tried rewriting the <code>setupCellAction()</code> in the following way:</p>
  
  <pre><code>private func setupCellAction() {
      collectionView?.rx.modelSelected(CellTypeCollectionViewCell.self)
          .asObservable()
          .debug("RX: Model selected")
          .subscribe(onNext: { [weak self] cell in
              print("itemSelected!")
              self?.performSegue(withIdentifier: "showBarchartSegue", sender: cell)
          }).disposed(by: disposeBag)
  }
  </code></pre>
  
  <p>It is not working either. I see also that it is subscribed once in the console. </p>
  
  <blockquote>
    <p>Update</p>
  </blockquote>
  
  <p><code>UICollectionViewController</code> was embedded in another container <code>UIViewController</code>, and in it I defined <code>UITapGestureRecognizer</code>. After commenting out the code for the <code>UITapGestureRecognizer</code>, the <code>itemSelected()</code> method started to work. Right now I need a way to let the tap event through if it happened on the <code>UICollectionViewCell</code>. Is there a way to do that?</p>
  
  <p>The code for tapping in the container controller (<code>viewDidLoad</code>):</p>
  
  <pre><code>let tap = UITapGestureRecognizer(target: self, action: 
  #selector(self.handleTap(_:)))
      tap.delegate = self
      view.addGestureRecognizer(tap)
  </code></pre>
  
  <p>The <code>handleTap():</code></p>
  
  <pre><code>@objc func handleTap(_ sender: UITapGestureRecognizer) {
      tableView.isHidden = true
      searchBar.resignFirstResponder()
  }
  </code></pre>