Change the size of pushed viewcontroller - ios

I'm presenting a ViewController which has UINavigationController. Is it possible to change the size of whole NavigationViewController just like when showing UINavigationViewController in UIPopOver and the size can be handled with setContentSizeInPopOver. Right now I'm not using UIPopover but I want to change the size of pushed view controller. Setting the frame of UINavigationController of pushed controller in viewDidload isn't helping.

For changing the size of view controller that is to be presented u could use this one
How to present a modal view controller with custom size in center?

Not tested.
Try changing the frame of the view controller view's superview to desired frame just before presenting the navigation controller. Remove all the auto re-sizing masks of the view.

Related

Changing frame of presented navigation view controller from custom UIPresentation Controller not changing bounds of navigation controller childrens

I am presenting a navigation controller with custom transition and custom presentation controller. Presentation controller listen for keyboard, and change presented view controller frame accordingly.
In first screen keyboard is active so presented view controller use smaller frame
I have set red background for navigation controller. When 2nd screen comes it dismiss keyboard, and the frame of presented view controller is increased. Although navigation controller frame changes as require it doesn't change frame for its children views
Any idea how can i fix this issue

iOS9 UIPopoverPresentationController UIModalPresentationPopover display at full width

I have a UIViewController instance with a modalPresentationStyle of UIModalPresentationPopover. There are gutters in between the left and right of the popover that I want to remove so that the popover is essentially full-width.
What attributes can I adjust to remove the left and right gutter?
The width of a popover is governed by the preferredContentSize of its view controller. If you want total control over the size of a presented view, though, you should use a presented view controller and your own UIPresentationController subclass.
Another property to consider is the popoverLayoutMargins of the UIPopoverPresentationController.

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.

instantiateViewControllerWithIdentifier and freeform view

I'd like to create a sort of popup view that is displayed in a main controller through custom transitions.
I create the popup viewcontroller into a storyboard and I set its view as freeform, then I resize the view.
My problem is that when I load the view controller using instantiateViewControllerWithIdentifier the view bounds are always reset to full screen.
Here is the code that I'm using, the popUp size should be 100x100, but from this code I get 320X480.
self.popUp = (PopUpViewController*)[storyBoard instantiateViewControllerWithIdentifier:#"Popup"];
NSLog(#"%#",NSStringFromCGRect(self.popUp.view.bounds));
How can I setup a freeform view controller and load it programmatically with the right size?
Solution at Wrong frame value while accessing the view from storyboard in IOS worked for me.
Uncheck the "Resize View From Nib" box in the inspector. That should
give you the correct size for a freeform view controller.

How to make the target view a subview of window using storyboard segue?

I am using storyboard and trying to segue from a bar view to a full screen view where the bar view's parent view is the same size as the bar view and is clipping subviews, but I'd like the destination view to take the full screen. Is there an easy way to do this by setting the properties of either the segue or the destination view controller? What is the proper way to do this? I really would like to make the full screen view a subview of window.
Thanks for any suggestions!
Luverio
I had to go around the segue by manually instantiate the target view controller and add it as the window's rootViewController.

Resources