title: iOS UIPopoverPresentationController positioning issue
body: <p>I'm trying to call a UIPopoverPresentationController from a UIBarButtonItem but having issues with positioning it correctly. Especially after rotation.</p>
  
  <p>Here is how it looks in portrait:
  <a href="https://i.stack.imgur.com/jJGuY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jJGuY.png" alt="enter image description here"></a></p>
  
  <p>This is how it looks in landscape:
  <a href="https://i.stack.imgur.com/Lhuzi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Lhuzi.png" alt="enter image description here"></a></p>
  
  <p>Notice where the arrow points to before and after rotation. Also notice how after rotation suddenly the arrow becomes grey (as default) although I clearly stated it to be white.</p>
  
  <p>Here is my implemetation code:</p>
  
  <pre><code>self.delegate?.popoverMenuWillShow()
  self.vc = inViewController
  self.barButtonItem = sender
  self.conversationQuery = conversationQuery
  self.modalPresentationStyle = UIModalPresentationStyle.Popover
  
  if let view = sender.valueForKey("view") {
      self.popover = self.popoverPresentationController!
      self.popover!.barButtonItem = sender
      self.popover!.permittedArrowDirections = .Up
      self.popover!.backgroundColor = UIColor.whiteColor()
      self.popover!.delegate = self
      self.vc!.presentViewController(self, animated: true, completion: { () -&gt; Void in
          self.delegate?.popoverMenuDidShow()
      })
  }
  </code></pre>
  
  <p>I've tried using .sourceView and .sourceRect in order to better its position but there is always an offset in how it's presented in portrait vs landscape. Regarding the color of the arrow, i've tried defining it as white again in viewDidLayoutSubviews but it didn't help.</p>
  
  <p>Anyone has an idea?</p>