Reputation: 11257
Using Xcode 7, my storyboard segues to popover are mis-aligned.
For example, if I simply drag a popover segue from a button, the arrow aligns to the top left of the button, instead of the center.
However, if I set the button directly, it's way off:
if segue.identifier == "seguePopoverSort" {
let pop = segue.destinationViewController.popoverPresentationController!
pop.sourceRect = btnSort.frame
return
}
It's an iPad app in landscape, but the same issue happens in portrait. I have auto-layout turned on.
Anyone have any ideas?
Upvotes: 1
Views: 129
Reputation: 14321
The only thing that I can think of is that you are only setting your sourceRect. You need to also set your "sourceView". This must be the view that contains your source rect.
If you set that, I believe it will solve your problem.
Upvotes: 1