It is iOS default presentation style for controllers. It's called UIPopOverPresentationController
. Here's a good article on presentation controllers. After that you might want to create two to three cells for your options in a UITableView
and add that as controller for the popover from your storyboard.
You can also change the popover arrow pointing location and direction which you might need when you want to support your app for iPad as well. :)
@IBAction func actionWasTapped(sender: UIBarButtonItem) {
let storyboard : UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
let vc = storyboard.instantiateViewController(withIdentifier: "PopOverVC")
vc.modalPresentationStyle = .popover
let popover: UIPopoverPresentationController = vc.popoverPresentationController!
popover.barButtonItem = sender
present(vc, animated: true, completion: nil)
}