Presenting UIimagepickercontroller from popover with transition from right - ios

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?

Related

UITabBar attachment view, conform to hidesBottomBarWhenPushed

How can we attach a view to a UITabBar or UITabBarController and allow it to conform to things like "Hide bottom bar on push"? Any view that gets added to the UITabBarController will a part of the UINavigationController, meaning that the view will not take part in the tab bar animation, and will simply be left visible after a push.
Is it frowned upon to subclass UITabBar itself, and if not, how would we handle the subviews of it? My attachment is located behind the tab bar and becomes visible when needed (like Spotify's or Apple Music's player bar), which causes problems when iOS automatically moves the z-index of the tab bar during these situations.

Hide UINavigationBar 3D touch

I am trying to 3D peek and pop items in a UITableView. Everything works fine, except the target ViewController has a UINavigationBar which also shows.
I added my UINavigationBar to my ViewController code through Interface Builder and set self.navBar.isHidden to true which hides the UINavigationBar, but it leaves empty space equal to the size of the UINavigationBar.
Does anyone know how to hide the UINavigationBar properly?
Note: I am not using a UINavigationController, I simply added the UINavigationBar to my ViewController by drag/drop.
the target ViewController has a UINavigationBar which also shows
Use a real UINavigationController plus UITableViewController (as its root view controller). This is an excellent way to have a navigation bar even if you never intend doing any navigation.
Here's a big advantage of doing that: You don't even need to hide the navigation bar when you peek! Use the UITableViewController alone as the peek navigation controller, and the UINavigationController when you pop. Thus, the preview won't have any navigation bar but if the user presses all the way and you do the real transition, the new view controller will have the navigation bar. Remember, no law says that the peek view controller must be the same as the pop view controller!

How to present UIImagePickerController in popover from a popover?

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.

Show/hide dismiss button in a UIPopoverPresentationController

I have a UINavigationController that I'm presenting in a popover using UIPopoverPresentationController.
The navigation controller must be presented when displayed in both popover and fullscreen mode (as the adaptive system so chooses.)
I have all this working.
The problem comes when I want to show/hide a dismiss button in the navigation controller depending on how it's being presented. I can't seem to determine whether I'm popover or fullscreen?
The WWDC stuff talks about returning a new navigation controller in presentationController:viewControllerForAdaptivePresentationStyle - but that's no good in my case as my navigation controller may have had other controllers pushed onto it and so cannot simply be swapped out.
Any pointers would be most welcome.
Thanks
[UPDATE] So the presenting view controller gets traitCollectionDidChange: and if it's horizontal compact then I poke into the presentedViewController->childViewControllers[0].navigationItem.leftBarButtonItem and set it to 'close'. But boy does this feel hacky.
[UPDATE2] So this link helps Close button on adaptive popover but the dismiss button is not then cleared when it switches back out to regular width.

Instagram style camera transition

Is there a way to create an Instagram style camera transition, where the current ViewController slides down to reveal the camera ViewController behind it? If so, how can I implement it, and make it work with the UINavigationController nav stack?
Take a screenshot of your current view controller and present another view controller modally with that screenshot, create a UIImageView in the new view controller you presented, then dismiss the screenshot down revealing the contents of that view controller underneath

Resources