Created
December 7, 2014 01:16
-
-
Save amonshiz/cf52ae5ae72585acf25a to your computer and use it in GitHub Desktop.
Presenting a view controller with the new UIPresentationController
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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