> On Mar 6, 2020, at 09:04, Gabriel Zachmann via Cocoa-dev > <cocoa-dev@lists.apple.com> wrote: > > Is it possible to share one NIB/XIB between two different apps? > If yes, what would be the best approach for development: different Xcode > projects, or different targets within the same Xcode project?
Sure. The easiest way is to have both products in the same project, but different targets, of course. The targets can share anything in the project. The harder way is to put all the common code and resources into a framework, then add the framework to each project. I use the first method in my screensaver and desktop image randomizer to share the UI as a self-contained view controller. > .Dummy question on the side: > so far, the screensaver framework opens the options sheet for me when the > user clicks "Screen saver options". > How would I open it "manually" in my standalone app? The same way you load and show any window. You could add a custom view to your app’s window, then load the shared view controller from its nib and add it to the custom view. Look for Apple examples/docs for loading nibs, using view controllers, etc. Steve via iPhone _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com