I tried to figure out how to solve this problem.
This line popover.permittedArrowDirections = ( .Up | .Down )says: "The type of expression is ambivalent without additional context."
Here is a sample code:
if let popover = alert.popoverPresentationController
        {
        popover.sourceView = imageView
        popover.sourceRect = imageView.bounds
        popover.permittedArrowDirections = ( .Up | .Down )
        }
source
share