Is it possible to present a popover without any sort of arrows pointing somewhere?
Swift3, this code work for me
popover.permittedArrowDirections = .init(rawValue: 0)
Try this , it works for me.
[self.popoverViewController presentPopoverFromRect:rect inView:self.view permittedArrowDirections:0 animated:YES];
I use popover to show menu depending on touch coordinate. In this case popover uses maximum height of self.view
CGRect popeverFrame = CGRectMake(touchPoint.x, touchPoint.y, 0, 0);
[self.popover presentPopoverFromRect:popeverFrame
inView:self.view
permittedArrowDirections:UIPopoverArrowDirectionAny
animated:YES];
But when I use 0-direction. Popover rectangle doesn't set it height to maximum and can only be set by appropriate property.
CGRect popeverFrame = CGRectMake(touchPoint.x, touchPoint.y, 0, 0);
[self.popover presentPopoverFromRect:popeverFrame
inView:self.view
permittedArrowDirections:UIPopoverArrowDirectionAny
animated:YES];
Hope this will help: Help with UIPopOverController size
To make a pop over direction none and make it to appear in center of the view controller :
let PopSrnVar = popoverPresentationController
let ConRctVar = view.frame
PopSrnVar!.sourceRect = CGRectMake(ConRctVar.width/4, ConRctVar.height/4, ConRctVar.width/2, ConRctVar.height/2)
// To make arrows as none
PopSrnVar!.permittedArrowDirections = UIPopoverArrowDirection()
For Swift 2.0
and iOS9
the solution is:
popoverViewController?.permittedArrowDirections = UIPopoverArrowDirection()
In Swift, you can simply do:
popoverPresentationController.permittedArrowDirections = []
Since in another configuration you could have used:
popoverPresentationController.permittedArrowDirections = [.up, .down]