Search code examples
iosxcodeswiftpopover

How to present popover ArrowDirections properly in iOS 9 swift


I have been trying to find out that how can fix the problem.

On this linepopover.permittedArrowDirections = ( .Up | .Down ) It says "Type of expression is ambiquous without more context."

Here's the code example:

if let popover = alert.popoverPresentationController
        {
        popover.sourceView = imageView
        popover.sourceRect = imageView.bounds
        popover.permittedArrowDirections = ( .Up | .Down )
        }

Solution

  • Please use below code:

    popover.permittedArrowDirections = [ .Up, .Down ]