Re: Sharing NIB/XIB between different apps?
Re: Sharing NIB/XIB between different apps?
- Subject: Re: Sharing NIB/XIB between different apps?
- From: Dave via Cocoa-dev <email@hidden>
- Date: Mon, 9 Mar 2020 10:29:01 +0100
Hi,
If you decide to use multiple targets then it’s still better to have a folder
for common files and one for each target, both targets include the Common
folder but you only include the folders appropriate for each Target. By
“include” I mean you check/uncheck the targets that the file builds against, so
Common files are checked for to project and the specific files only for the
target they belong to.
You can also use a “Workspace”, which is what I tend to do, you then add
projects to the work-project (which can have sub-projects), it’s all a bit
complicated to be honest, but the docs are pretty good. The best way to find
out more, is to find a Sample project that uses a Workspace and go from there.
Hope this helps
Dave
> On 6 Mar 2020, at 16:19, Steve Mills via Cocoa-dev
> <email@hidden> wrote:
>
>> On Mar 6, 2020, at 09:04, Gabriel Zachmann via Cocoa-dev
>> <email@hidden> 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 (email@hidden)
>
> 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:
>
> This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden