Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

instantiateViewControllerWithIdentifier and freeform view

Tags:

ios

storyboard

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?

like image 300
MatterGoal Avatar asked Nov 14 '13 10:11

MatterGoal


1 Answers

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.

like image 192
Varuna Avatar answered Nov 15 '22 23:11

Varuna