Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Interface Builder - where is the documentation

I have many times looked for XCode documentation for things like (1.) icons in the editor intellisense. My latest documentation problem is in Interface Builder:

When you have a .xib file. Then you have "Placeholders" for "File's Owner" and the UIView itself - (2.) Where should I set "custom class" & (3.) what is "Inherited From Target"

Can you help me help finding informations for XCode UI/IB documentations?

like image 435
Chris G. Avatar asked Apr 12 '17 11:04

Chris G.


People also ask

How do I open Apple interface builder?

First, in Xcode, go to the Resources folder from the tree view on the left and select MainMenu. xib . It will open in the main view. This is where you are going to build you UI.

What is Interface Builder in Swift?

Interface Builder The first is an editor, where you write the Swift code that makes your application run. The second is Interface Builder, which is the part where you lay out the graphical interface of your program—the buttons, toolbars, menus, images, and text that make up how your users interact with your program.

When prepareForInterfaceBuilder is called?

prepareForInterfaceBuilder() Called when a designable object is created in Interface Builder.


1 Answers

I can help on the "Inherited from Target" option of Custom Class.

My project has a variety of targets (free, paid, home free, home paid) and I have a class that is only used in the home variants.

When I just added my class and let it default to Module I kept getting an error at run time that the class was not defined in the storyboard.

By checking the "Inherited from Target" option the module gets compiled in for the targets I use it in (Target Memberships for swift file and everything works.

I am assuming this was an optimization so the module would not be included when not needed - but that is just a guess.

Needless to say this wasted an entire day to figure out - hope it helps some others.

like image 53
DaddyCat941114 Avatar answered Sep 18 '22 15:09

DaddyCat941114