title: Present modal view controller in half size
body: <p>I tried to implement presenting <code>modal view controller</code> on the other <code>UIViewController</code> sized to half parent view controller as:</p>
  
  <pre><code>class ViewController: UIViewController, UIViewControllerTransitioningDelegate {
  
      override func viewDidLoad() {
          super.viewDidLoad()
      }
  
      @IBAction func tap(sender: AnyObject) {
          var storyboard = UIStoryboard(name: "Main", bundle: nil)
          var pvc = storyboard.instantiateViewControllerWithIdentifier("CustomTableViewController") as UITableViewController
  
          pvc.modalPresentationStyle = UIModalPresentationStyle.Custom
          pvc.transitioningDelegate = self
          pvc.view.backgroundColor = UIColor.redColor()
  
          self.presentViewController(pvc, animated: true, completion: nil)
      }
  
      override func didReceiveMemoryWarning() {
          super.didReceiveMemoryWarning()
      }
  
      func presentationControllerForPresentedViewController(presented: UIViewController, presentingViewController presenting: UIViewController, sourceViewController source: UIViewController) -&gt; UIPresentationController? {
          return HalfSizePresentationController(presentedViewController: presented, presentingViewController: presenting)
      }
  }
  
  class HalfSizePresentationController : UIPresentationController {
      override func frameOfPresentedViewInContainerView() -&gt; CGRect {
          return CGRect(x: 0, y: 0, width: containerView.bounds.width, height: containerView.bounds.height/2)
      }
  }
  </code></pre>
  
  <p>Now I need to dismiss my half sized view controller when user click the parent view controller.<br>
  How to achieve this?</p>