0

I really like the way the settings are shown on the Books app and am trying to figure out how replicated it.

Screenshot of Books app with settings shown

Is this an .actionsheet that is somehow moved to show up under the Settings image or a container view that shows up on tap or something else? I'm still at level noob with a basic app and would like to implement this.

bobcat
  • 177
  • 1
  • 12

2 Answers2

1

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)
}
Amber K
  • 700
  • 1
  • 5
  • 20
0

This can done with a-lot of way , you can just create by UIView work as background with custom subview (PopOverMenu) done with UIBezierPath to draw this arrow with corner radius view

upon this pop over you can create MultiSection tableview or collection View or any

  1. Background is add as SubView to UIApplication.sharedApplication().keyWindow?.addSubview(background)
  2. Background have tab gesture to dismiss when tab on background
  3. some closure to bring back data that user select it
Abdelahad Darwish
  • 5,969
  • 1
  • 17
  • 35