iPad detail settings page like popup viewController - ios

The first thing i would like to clarify is that i'm not talking about the splitview controller. I want a pop up with a navigation controller similar to the one you get when you tap the Keyboard>>Languages or Mail>>New Account.
Now this is not a popover controller, any standard framework available for this? Maybe i'm missing the obvious. The good things about this is that it has navigation controller and hence the view resizes to fit subsequent tableview lengths.

This is not a popover. It's a modalView with presentation style UIModalPresentationFormSheet
Check this link
For more presentation styles refer ModalPresentationStyle
Presentation Styles
Presentation styles available when presenting view controllers.
typedef enum {
UIModalPresentationFullScreen = 0,
UIModalPresentationPageSheet,
UIModalPresentationFormSheet,
UIModalPresentationCurrentContext
} UIModalPresentationStyle;
Constants
UIModalPresentationFullScreen
The presented view covers the screen, taking into account the value of the wantsFullScreenLayout property.
Available in iOS 3.2 and later.
Declared in UIViewController.h.
UIModalPresentationPageSheet
The height of the presented view is set to the height of the screen and the view’s width is set to the width of the screen in a
portrait orientation. Any uncovered areas are dimmed to prevent the
user from interacting with them. (In portrait orientations, this
option is essentially the same as UIModalPresentationFullScreen.)
Available in iOS 3.2 and later.
Declared in UIViewController.h.
UIModalPresentationFormSheet
The width and height of the presented view are smaller than those of the screen and the view is centered onscreen. If the device is in a
landscape orientation and the keyboard is visible, the position of the
view is adjusted upward so the view remains visible. All uncovered
areas are dimmed to prevent the user from interacting with them.
Available in iOS 3.2 and later.
Declared in UIViewController.h.
UIModalPresentationCurrentContext
The view is presented using the same style as its parent view controller.
When presenting a view controller in a popover, this presentation style is supported only if the transition style is
>
UIModalTransitionStyleCoverVertical.
Attempting to use a different
transition style triggers an exception. However, you may use other
transition styles (except the partial curl transition) if the parent
view controller is not in a popover.
Available in iOS 3.2 and later.
Declared in UIViewController.h.

Related

Rotating a VC presented as UIModalPresentationOverCurrentContext

iOS 8. I am presenting a view controller with presentation style: UIModalPresentationOverCurrentContext. This works great until I rotate my device, at which time the presented view is not properly adjusted.
Example: I presented over a portrait context. Entire screen covered by my new view (which has semi-transparencies). I rotate to landscape. The presented view rotates, but is now centered and remains at portrait width.
Both the presenting VC and the presented view are created in a storyboard using autolayout. Since I can't add constraints to the topmost view in a VC (right?) I'm not sure how to keep my presented view entirely covering the view below it.
This can happen if Presentation in the Segue is set to Page Sheet. In the storyboard, change the presentation to Full Screen or Over Full Screen
Since you're not using a segue, use UIModalPresentationOverFullScreen.

"Present as Popover" segues and view size

Can anyone point to any guidance/documentation on how items should be placed in a view controller that will be displayed as a popover so that the components are appropriately positioned with auto layout?
Specifically: I'm working in Xcode 8.3 with the new "Present as Popover" segue, with the new "universal" storyboards. I add a view controller and then a popover segue to that view controller. When it is displayed, I see that roughly the top-left quadrant of the view controller is displayed as a popover, but that no auto layout appears to be taking place as far as I can see to accommodate the slightly different sizes of an iPad popover vs "full screen" behaviour on the different sized iPhones -- so in effect, a slightly different section of the view controller is visible depending on the device.
I assume this isn't really how things are supposed to work, and the whole raison d'être of the universal popover segue is to appropriately fit things to the popover size via auto layout? So can anyone shed some light on what I'm doing wrong or how popups are supposed to work with respect to auto layout?
Something to watch for with popovers is that on devices like the iPad, the size class for the popover is not the same as the controller which raises it.
You will probably find that the size class goes from regular width to compact width when you use a popover on an iPad. If you have layout coded to regular width for your popover content, then it will not work in the popover.
The size of the popover itself comes from the content size properties for the controller presented. You can set this size explicitly in the attribute inspector for the view controller or in code. See: How to present popover properly in iOS 8
To make the elements display correctly on screen, change the size class control to Any-Any (near the layout toolbar at the bottom of the Interface Builder canvas) before adding elements in the Storyboard in the View Controller that will act as a popover.

Presenting transparent modal UIViewController on iPad iOS 7

I have an iPad app which supports all orientations and has a UITabBarController managing a set of view controllers. Rotation works as expected everywhere. Keep in mind my UITabBarController is the .rootViewController of my app's UIWindow.
I now go to present a UIViewController modally from my UITabBarController. It presents well, and the status bar moves in accordance with the device's orientation. However, my UIViewController's view frame never changes (it is always in portrait dimensions, regardless of how it was presented).
This isn't an issue on iOS 8, and I thought UITabBarController would handle a modal controller on its own. Is there something I'm missing?
Bonus: ultimately this UIViewController will be transparent and reveal the app beneath it. When I try this and rotate my device, none of the regular view controllers rotate.
However, my UIViewController's view frame never changes (it is always in portrait dimensions, regardless of how it was presented).
This is expected. In iOS 7, rotation was implemented by applying a transform to the top-level view controller's view. The application of this transform does not alter the frame, which remains in portrait dimensions. In iOS 8, rotation is implemented at the window level.
Bonus: ultimately this UIViewController will be transparent and reveal the app beneath it. When I try this and rotate my device, none of the regular view controllers rotate.
The UIModalPresentationStyleFullscreen presentation style removes the presenter's view from the window while it is covered by the presented view controller. If you modify the alpha of the presented view controller's view, you'll just see black underneath.
Since UIModalPresentationStyleOverFullscreen did not exist in iOS 7, you would need to use UIModalPresentationStyleCustom with your own transition animator. Unfortunately, custom transitions with view controllers that can rotate is extremely buggy in iOS 7.

How do I resize a UINavigationController's contents when a UISplitViewController rotates to portrait

I have a UISplitViewController that uses a navigation controller for its master (left) pane. When it rotates to portrait, this navigation controller is represented within a UIPopoverController. I'm noticing that the UITableView that is being shown in the navigation controller's current view does not resize when the app rotates to portrait. Namely, I see the popover at full height (about 1024 pixels), but the table is black along the bottom, seemingly still about 700 pixels in height.
How do I adjust the navigation and/or table view height properly?
This question is old, but for future reference, the documented way of handling this is to set the contentSizeForViewInPopover property on the view controller. You can also use the popoverContentSize property of the popover controller. See the dev docs for details.

iPad - General Network->What is the UI control?

In the below image, what is the UI control used to create the "Other Network" dialog? We need to create a similar non-full-screen popup.
I think what you're looking for is a UIModalPresentationFormSheet.
From Apple's UIViewController documentation reference
UIModalPresentationFormSheet
The width and height of the presented view are smaller than those of the screen and the view is centered on the screen. If the device is in a landscape orientation and the keyboard is visible, the position of the view is adjusted upward so that the view remains visible. All uncovered areas are dimmed to prevent the user from interacting with them.
Available in iOS 3.2 and later.
Declared in UIViewController.h.
See this article for an example Display a view using modalPresentationStyle
It should be a view controller presented modally using UIModalPresentationFormSheet as its modalPresentationStyle.

Resources