title: PopoverPresentationController delegate methods not called
body: <p>I have a class to construct a UIPopoverPresentationController in an empty swift file:</p>
  
  <pre><code>import Foundation
  import UIKit
  
  class Popovers : NSObject, UIPopoverPresentationControllerDelegate {
  
      func presentLoginScreen() {
          // Presenting login Popover
  
          let storyboard = UIStoryboard(name: "Main", bundle: nil)
          let loginScreen = storyboard.instantiateViewControllerWithIdentifier("LogInScreen")
  
          let window = UIApplication.sharedApplication().windows.last!
          let height = window.screen.bounds.size.height
          let width = window.screen.bounds.size.width
  
          loginScreen.modalPresentationStyle = UIModalPresentationStyle.Popover
          loginScreen.preferredContentSize = CGSizeMake(width * 0.85  , height * 0.35)
  
          let loginScreenPopover = loginScreen.popoverPresentationController
          loginScreenPopover?.permittedArrowDirections = UIPopoverArrowDirection.init(rawValue: 0)
          loginScreenPopover?.delegate = self
          loginScreenPopover?.sourceView = window.rootViewController?.view
          loginScreenPopover?.sourceRect = CGRectMake(CGRectGetMidX(window.screen.bounds), CGRectGetMidY(window.screen.bounds), 0, 0)
  
          window.rootViewController?.presentViewController(loginScreen, animated: true, completion: nil)
  
          let blur = UIVisualEffectView(effect: UIBlurEffect(style: .Light)) as UIVisualEffectView
          let bounds = window.screen.bounds
          blur.frame = bounds
          blur.autoresizingMask = [.FlexibleWidth, .FlexibleHeight]
          window.rootViewController!.view.addSubview(blur)
  
      }
  
      func adaptivePresentationStyleForPresentationController(controller: UIPresentationController) -&gt; UIModalPresentationStyle {
          return UIModalPresentationStyle.None
      }
  
      func popoverPresentationControllerDidDismissPopover(popoverPresentationController: UIPopoverPresentationController) {
          // Remove blur layer
          print("method called")
          let window = UIApplication.sharedApplication().windows.last
          window?.subviews.last?.removeFromSuperview()
  
  
      }
  
  
  }
  </code></pre>
  
  <p>But whenever I dismiss the PopoverPresentationController the delegate method <code>popoverPresentationControllerDidDismissPopover</code> is never fired.</p>
  
  <p>I have set the delegate of the loginScreenPopover to self and let the Popovers class inherit from the UIPopoverPresentationControllerDelegate but neither seems to be working. </p>
  
  <p>It is on an iPhone, if that is relevant to the question. </p>