How to present UIImagePickerController in popover from a popover? - ios

Consider the following scenario on an iPad app:
The app is showing a fullscreen UINavigationController with some content.
When pressing a navigationbar button, a popover is shown (that shows a table with various controls).
A table cell in that popover offers to pick a photo from the device's photo library. For this, the UIImagePickerController shall be used.
According to the iOS HIG, the UIImagePickerController must be shown as a popover on the iPad.
Question:
What is the best way to present the UIImagePickerController in a popover in the above situation? (ie. from a popover)
Clearly I cannot show the UIImagePickerController popover from another popover.
Should I show the first popover content in a form sheet, allowing the UIImagePickerController to open in its own popover?
Or: When the button to show UIImagePickerController is pressed, should I dismiss the popover and show UIImagePickerController in a new popover from the same navigationbar button? At first glace this looks like an odd solution to me, but on the other hand it compares to the perfectly legal way to show UIImagePickerController in a popover when pressing a button in a UIAlertController/action sheet (which itself is technically a popover, too).
Any ideas are appreciated.

Related

How to avoid having two UIPopoverPresentationControllers up at same time each from UIBarButtonItem in UItoolBar

I'm in the process of converting an old iOS app which uses UIPopoverController to the new UIPopoverPresentationController. I have two popovers (A & B) each initiated from a click on a UIBarButtonItem (butA, butB) in a UIToolBar. I have the popovers each displaying fine. If I click in the main view the popovers disappear correctly.
If I press butA popover A appears. If I then press butB nothing happens. In this case, the popover controller B was being presented from the UIBarButtonItem (butB).
If I present the popovers from a sourceRect near butA and butB, I get a slightly different result. Click on butA and popover A appears. Click on butB popover A disappears. Click on butB a second time, then popover B appears.
How can I get this to work correctly, with popover A disappearing when I single click on butB? I have tried to dismiss ViewController A as part of the butB press action, but the ViewController A object at that point is nil.
Any help would be appreciated.

Presenting UIimagepickercontroller from popover with transition from right

I have a root UIViewController showing photos (on a UINavigationController) displayed on a PopOverController in ipad.
I have a rightBarButtonItem on my root UIViewController which evokes a UIImagePickerController. I am able to display the PickerController in my PopOver Size by cameraViewCtrl.modalPresentationStyle=UIModalPresentationCurrentContext;
But it always appears from bottom, I am looking to present it from right to left like native navigation push transition style. I have referred this : link .This is not the solution because it move the entire window from right and not just the PopOver's UIImagePickerController.
Is it due to UIModalTransitionStyle is UIModalTransitionStyleCoverVertical by default and I don't want a flip transition by UIModalTransitionStyleFlipHorizontal.
Is there any alternate way out to present a UIImagePickerController in a navigational transition way from right to left style?

UIPopoverController over UIPopoverController

I have a main view with a button, when clicked will open a UIPopoverController, in a UIPopoverController there is another button which should open another UIPopoverController. Is it possible to do?
As per Apple says you should not use UIPopoverController over UIPopoverController,
Instead you can use UINavigationController in side UIPopoverController.
Edit:-
rmaddy's Comment
From the "iOS Human Interface Guidelines": Ensure that only one popover is visible onscreen at a time. You shouldn’t display more than one popover (or custom view designed to look and behave like a popover) at the same time. In particular, you should avoid displaying a cascade or hierarchy of popovers simultaneously, in which one popover emerges from another

UIActionSheet on iPad comes up from the bottom when the parent view is a UIPopover

On iPad, I have a view that is a popover. There is a button inside the view that shows a UIActionSheet. When I call showFromBarButtonItem:animated, instead of showing up as a popover as I would expect, I instead get an action sheet that comes up from the bottom of the view. Does anyone know a way to force it to be a popover on top of the existing popover? Everything works fine if my view that shows the UIActionSheet is not a popover.
This behavior is probably because you are calling the UIActionSheet object from within your popover controller, which probably has bounds comparable to that of the iPhone screen size. When you call from within this controller the method showFromBarButtonItem:animated: it gets the bounds of this reduced size popover controller and launches the action sheet object just like on an iPhone from the bottom.
What you would probably need to do is nest popover controllers to achieve your desired effect.

MPMoviePlayerController is hidden behind a modal UIViewController

On the iPad with iOS 4.3.
I've created a UIViewController.
I added a MPMoviePlayerController to the view controller, and loaded a movie.
I presented the UIViewController modally using UIModalPresentationFormSheet
I got what I wanted, a movie playing in a popup in the center of the screen..
But when I tap on the "enter full screen" button, the movie appears BEHIND the modal UIViewController. I'm left with a black square where the movie was. I can see the movie in the background, but I can't interact with it.
I am guessing that I either need to do something in the EnterFullScreen notification, but I don't know what. Or I need to do something completely different to show my movie in a popup. Something that isn't quite modal.

Resources