I have some custom views that I want to reuse throughout my application.
I create a new Objective C class in XCode and set the type to 'NSViewController'. I check the box to create .xib file for the user interface. I can go ahead and construct my reusable view.
Now I want to add my reusable view into my MainWindow.xib. Is there a way to approach this using only Interface Builder (no code)?
I see I can add a 'Custom View' proxy into my MainWindow.xib. But it is still necessary to load my reusable view in code, and then swap it out for my custom view proxy at run time, e.g. (pseudo code)
UIView *myReusableView = [[[NSBundle mainBundle] loadNibNamed:@"ReusableView" owner:self options:nil] objectAtIndex:0]
[self.window.contentView replaceSubview:myCustomView with:myReusableView];
Every approach that I try, I always end up having to do some work in code. Is it not possible to compose custom NSViews (from .xib files) using Interface Builder alone? For example, this is possible in Windows Forms where one can compose custom User Controls using only the designer.