title: how to present a popover in custom cell in swift
body: <p>For presenting popover I am following the below code.</p>
  
  <pre><code>func showPopOver() {
      let secondStoryboard = UIStoryboard(name: "Second", bundle: nil)
  
      viewObj =  secondStoryboard.instantiateViewControllerWithIdentifier("ViewController") as! ViewController
      viewObj.modalPresentationStyle = UIModalPresentationStyle.Popover
      viewObj.preferredContentSize = CGSizeMake(400,500)
  
      let popoverPresentationController = viewObj.popoverPresentationController
      popoverPresentationController?.delegate = self
      popoverPresentationController?.sourceView = self.view //walletButton
      popoverPresentationController?.sourceRect = CGRectMake(0, button.frame.origin.y+100, 0, 0)
      presentViewController(viewObj, animated: true, completion: nil)
  }
  
  //MARK:- UIPopoverPresentationControllerDelegate methods... starts
  
  func adaptivePresentationStyleForPresentationController(controller: UIPresentationController) -&gt; UIModalPresentationStyle{
      return UIModalPresentationStyle.None
  }
  
  func prepareForPopoverPresentation(popoverPresentationController: UIPopoverPresentationController) {
      print("prepare for presentation")
  }
  
  func popoverPresentationControllerDidDismissPopover(popoverPresentationController: UIPopoverPresentationController) {
      print("did dismiss")
  }
  
  func popoverPresentationControllerShouldDismissPopover(popoverPresentationController: UIPopoverPresentationController) -&gt; Bool {
      print("should dismiss")
      return false
  }
  </code></pre>
  
  <p>its working fine in normal view controller, but i need to show a popover view in custom tableview cell.</p>
  
  <p>class flow like</p>
  
  <p>|-<code>UITableViewController</code></p>
  
  <p>|-CustomCell:<code>UITableViewCell</code></p>
  
  <p>|-<code>UIButton</code>: button action-> here we need to show a popover with 3/4 frame value of the tableview frame. </p>
  
  <p>whenever user tapped out of the popover view then dismiss the popover view. </p>