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

I have a custom view that needs to be displayed on all iPhone devices (4, 4S, 5, 5S, 6 and 6 Plus). When creating a custom XIB view, I referred to it as "Inferred", but it does not resize for iPhone 6 and iPhone 6 Plus devices. I can not understand this problem. I am confused by what would be the real differences between Inferred and Freeform. Can someone explain the differences?

+7
ios xcode xib storyboard
source share
2 answers

Intended resizes the scene to suit its parent scene. For example, if you have a scene the size of an iPad, and then you add a new scene to your storyboard and create a shogi for it, it will automatically resize to the same size as the iPad scene (where the segue starts),

Freeform ignores the rule above, and you can sort it as you wish, in the toolbar on the right.

Both of these, however, have nothing to do with how the representation is displayed and measured on real devices. For this you need to use auto layout and restrictions. Or springs and struts . Some even do this in code if they need more flexibility.

+12
source share

"Inferred" is the default setting for the storyboard, and this means that the navigation bar appears on the scene when it is inside the navigation controller, the tab bar when it is inside the controller of the tab bar, and so on. You can override these options if you want, but keep in mind that they are here only to help you create your screens. The Simulated Metrics argument used at runtime is just a visual aid that shows how your screen will look.

"FreeForm" Usually you use the freeform property when you add a view controller as a child to another view controller programmatically, and you really want to have this fixed size. If you click on a presentation controller or present it as a modal presentation controller (and you use modal presentation styles), then there is no need to use a free form. Also another use of the freeform property is to view the actual size of your view controller when it is presented as a modal view controller using existing presentation styles.

+3
source share

All Articles