title: UIPopoverController, Xcode 6, IOS 8 using Swift
body: <p>I'm having some trouble getting a UIPopover to appear using swift.  The code that is commented out works fine in Objective-C, but doesn't work using Swift. When I tap the + in my view controller I do get the "click" in my debugger, however no popover appears.</p>
  
  <pre><code>class PlayerInformationTableViewController: UITableViewController, NSFetchedResultsControllerDelegate, UIPopoverControllerDelegate {
  
      @IBOutlet weak var addBarButtonItem: UIBarButtonItem!
  
      var playerInformationViewController = PlayerInformationViewController()
      var popover:UIPopoverController?    = nil
  
      override func viewDidLoad() {
          super.viewDidLoad()
  
          /*
  
          //setup the popover
          _cuesPopoverViewController          = [self.storyboard instantiateViewControllerWithIdentifier:@"CuesPopoverViewController"];
          self.cuesPopover                    = [[UIPopoverController alloc] initWithContentViewController:_cuesPopoverViewController];
          self.cuesPopover.popoverContentSize = CGSizeMake(540, 300);
          self.cuesPopover.delegate           = self;
  
          */
  
      playerInformationViewController.storyboard?.instantiateViewControllerWithIdentifier("PlayerInformationViewController")
      popover?.contentViewController = playerInformationViewController
      popover?.popoverContentSize = CGSizeMake(300, 300)
      popover?.delegate = self
  
  
          // Uncomment the following line to preserve selection between presentations
          // self.clearsSelectionOnViewWillAppear = false
  
          // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
          // self.navigationItem.rightBarButtonItem = self.editButtonItem()
      }
  
  @IBAction func addPopover(sender: AnyObject) {
  
      println("Click")
  
      popover?.presentPopoverFromBarButtonItem(addBarButtonItem, permittedArrowDirections: UIPopoverArrowDirection.Any, animated: true)
  
  }
  </code></pre>
  
  <p>Solution</p>
  
  <pre><code>  override func viewDidLoad() {
          super.viewDidLoad()
  
       }
  
  @IBAction func addPopover(sender: AnyObject) {
  
      var popoverViewController = self.storyboard?.instantiateViewControllerWithIdentifier("PlayerInformationViewController") as UIViewController
      popoverViewController.modalPresentationStyle = .Popover
      popoverViewController.preferredContentSize   = CGSizeMake(450, 450)
  
      let popoverPresentationViewController = popoverViewController.popoverPresentationController
  
      popoverPresentationViewController?.permittedArrowDirections = .Any
      popoverPresentationViewController?.delegate = self
      popoverPresentationViewController?.barButtonItem = sender as UIBarButtonItem
  
      presentViewController(popoverViewController, animated: true, completion: nil)
  
  }
  </code></pre>