Friday, January 27, 2017

Interface Builder: View Is Clipping Its Content

Daniel Jalkut:

At this point you can usually just “size to fit” and Interface Builder will use its knowledge of the control’s class, and that class’s ability to size itself to suit its content. Or, if you’re using Auto Layout, it might mean that you need to ask Interface Builder to update the items’s frame, allowing Auto Layout to essentially size to fit for you.

In this case however I have a conundrum: both “size to fit” and AutoLayout insist this is the proper size and placement for the control, yet Interface Builder is still convinced the control will clip its content (the text of the menu item title).


I can’t win: if I let Auto Layout have it’s way, I get an annoying clipping notice. If I let the clipping notice have its way, Auto Layout throws a fit.

This hasn’t worked properly in years. Another reason to go nibless.

5 Comments RSS · Twitter

Going nibless and writing and maintaining thousand of UI line of code to avoid an IB warning is a little extreme…

@Jean-Daniel Yes, but that’s not the only benefit.

Cocoa developers are finding it's easier to work with code than nib files? How the world is changing!

@Kevin Not developers, mostly coders.

Using only code for the UI is fine if you are just implementing specs. Because you are provided with wireframes. And you can make the app look pixel for pixel exactly (and poorly sometimes) like the specs.

If you are developing (coding and designing) the app, using xib/nib is still more powerful and fast.

Yes, it's half a troll, but also half what I've seen so far.

@Kevin "Cocoa developers are finding it's easier to work with code than nib files? How the world is changing!"

To be fair, XCode itself has changed quite a bit since those nib/no-nib arguments began. So it isn't quite the same argument anymore.

Leave a Comment