Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

xib files in Xcode 8.2 is not working properly.Is it a bug?

I am really frustrated since i migrated my project from Xcode 7.3 to Xcode 8.2. I am using both storyboard and Xib files in my project . While running my project I am getting this weird error. Some of my xib files are resized or reshaped(shrinked To fit/Expanded To fit). All this Xib files worked 100% perfectly in Xcode 7.3.

ScreenShot: screenShot

As you can see above the above view controller xib is as on Iphone5. But while running it expands to the blue lines. I am perfectly sure the auto layout is correct. I have solved this by changing the opening type of the xib document from Xcode8 to Xcode7,but to no good effect. It seems repeating again and again. In the above layout my views are arranged like this. Why is this happening. Is it a bug

Already tried: Link

ScreenShot: enter image description here

like image 249
Jeesson_7 Avatar asked Oct 29 '22 09:10

Jeesson_7


2 Answers

This is a known bug in Xcode. Your best option would be to update to Xcode 8.3 and migrate your Swift 2.3 code to 3.1.

like image 184
Oskar Avatar answered Nov 15 '22 06:11

Oskar


With Xcode 8, it's highly recommended to use Size classes with universal layout developed using AutoLayout constraints. This helps in designing the user interface to support all iOS device family variants and also supports all device orientations. XIB files should be used as references and using the same UI controls on storyboard UI views.

like image 21
Gurdev Singh Avatar answered Nov 15 '22 07:11

Gurdev Singh