title: How to present popover properly in iOS 8
body: <p>I'm trying to add a UIPopoverView to my Swift iOS 8 app, but I am unable to access the PopoverContentSize property, as the popover does not show in the correct shape. my code:</p>
  
  <pre><code>var popover: UIPopoverController? = nil 
  
      func addCategory() {
  
      var newCategory = storyboard.instantiateViewControllerWithIdentifier("NewCategory") as UIViewController
      var nav = UINavigationController(rootViewController: newCategory)
      popover = UIPopoverController(contentViewController: nav)
      popover!.setPopoverContentSize(CGSizeMake(550, 600), animated: true)
      popover!.delegate = self
      popover!.presentPopoverFromBarButtonItem(self.navigationItem.rightBarButtonItem, permittedArrowDirections: UIPopoverArrowDirection.Any, animated: true)
  }
  </code></pre>
  
  <p>output:</p>
  
  <p><img src="https://i.stack.imgur.com/kwxBG.png" alt="enter image description here"></p>
  
  <p>When I am doing the same thing through UIPopoverPresentationController, I still don't get it done. this is my code:</p>
  
  <pre><code>func addCategory() {
  
      var popoverContent = self.storyboard.instantiateViewControllerWithIdentifier("NewCategory") as UIViewController
      var nav = UINavigationController(rootViewController: popoverContent)
      nav.modalPresentationStyle = UIModalPresentationStyle.Popover
      var popover = nav.popoverPresentationController as UIPopoverPresentationController
      popover.delegate = self
      popover.popoverContentSize = CGSizeMake(1000, 300)
      popover.sourceView = self.view
      popover.sourceRect = CGRectMake(100,100,0,0)
  
      self.presentViewController(nav, animated: true, completion: nil)
  
  }
  </code></pre>
  
  <p>I get the exact same output. </p>
  
  <p>How do I customize the size of my popover? Any help would be highly appreciated!</p>