Skip to content

Instantly share code, notes, and snippets.

@amonshiz
Created December 7, 2014 01:16
Show Gist options
  • Save amonshiz/cf52ae5ae72585acf25a to your computer and use it in GitHub Desktop.
Save amonshiz/cf52ae5ae72585acf25a to your computer and use it in GitHub Desktop.
Presenting a view controller with the new UIPresentationController
// Present the view controller using the popover style.
myPopoverViewController.modalPresentationStyle = UIModalPresentationPopover;
[self presentViewController:myPopoverViewController animated: YES completion: nil];
// Get the popover presentation controller and configure it.
UIPopoverPresentationController *presentationController = [myPopoverViewController popoverPresentationController];
presentationController.permittedArrowDirections = UIPopoverArrowDirectionLeft | UIPopoverArrowDirectionRight;
presentationController.sourceView = myView;
presentationController.sourceRect = sourceRect;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment