I'm using UIBarButtonItem. In my scenario I want to show a popover from every bar button when I double-click that bar button. So I use a UITapGesture from that UIBarButtonItem. But, the popover arrow always appear in the middle of all UIBarButtonItem.
I can't make the arrow appear in the middle of each bar button. My friend was telling me to set the arrow direction using point, but I don't know how to do that.
How can I set both the position and direction of the popover's arrow?
Set the direction for the popover using:
[yourPopover setPopoverArrowDirection: UIPopoverArrowDirectionDown];
You can also use UIPopoverArrowDirectionUp
, UIPopoverArrowDirectionLeft
, and UIPopoverArrowDirectionRight
, and UIPopoverArrowDirectionAny
.
For Swift
yourPopover?.permittedArrowDirections = .up // or .down, .left, .right
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With