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

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.

Related

What is the difference between "Inferred" and "Freeform" in Xcode Storyboard?

I have a custom view which needs to be displayed on all the iPhone devices(4, 4S, 5, 5S, 6 and 6 Plus). When creating the custom view XIB, I have mentioned it as "Inferred" but it is not resizing for iPhone 6 and iPhone 6 Plus devices. I am not able to figure out the issue. I am confused on what would be actual differences between "Inferred" and "Freeform". Can someone please explain the differences?
Inferred resizes the scene according to its parent scene. For example if you have a scene that is the size of an iPad and then you add a new scene to your storyboard and create a segue to it, it will automatically resize to the same size as the iPad scene (where the segue originates from).
Freeform ignores the above rule and you're able to size it as you see fit, in the utility pane on the right.
Both of these however have nothing to do with how the view is displayed and sized on actual devices. For that you need to use auto layout and constraints. Or springs and struts. Some even do it in code if they need more flexibility.
“Inferred” is the default setting for storyboards and it means the scene will show a navigation bar when it’s inside of a navigation controller, a tab bar when it’s inside of a tab bar controller, and so on. You could override these settings if you wanted to, but keep in mind they are here only to help you design your screens. The Simulated Metrics aren’t used during runtime, they’re just a visual design aid that shows what your screen will end up looking like.
"FreeForm" Usually you use the freeform property when you add the view controller as a child to another view controller programmatically and you really want to have that fixed size.If you push the view controller or you present it as modal view controller (and you use the modal presentation styles) then there is no need to use freeform.Also another use of the freeform property is to preview the actual size of your view controller when is presented as a modal view controller using existent presentation styles.

"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.

iPad application, changing popover dimensions whilst view is loaded

I have an app in which its my intention to change screen orientation as the user rotates the iPad. In my app I have several popovers.
The potential issue I'm concerned about is one of my popovers covers most the screen so if rotation changes, I'd want the popover to change view dimensions. Is it possible whilst a view is open or will i have to close it and reopen it.
Thanks
If your using a UIPopoverController the standard behaviour it does is to hide the popover when you rotate. It try's to then reposition it for you, this tends not to work so you want to use popoverController:willRepositionPopoverToRect:inView to set your new position and resize as needed.
If you use setPopoverContentSize:animated: it will re size for you, If your using autolayout you'll want to use preferredContentSize in the content viewController.
Apple Doc:
If the user rotates the device while a popover is visible, the popover
controller hides the popover and then shows it again at the end of the
rotation. The popover controller attempts to position the popover
appropriately for you but you can also implement the
popoverController:willRepositionPopoverToRect:inView: method in the
popover delegate to specify a new position.

iPad detail settings page like popup viewController

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.

Resources