Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using the same code for different target in Xcode

Tags:

module

xcode

ios

I want to use the same code for different target in Xcode. I am able to create the target using the Duplicate method and then I am able to change scheme name as well.

Now the real scenario comes, I want to be use my code in centralised way like for new target, I don't want to copy and paste the Main.storyboard and xib as well, so, ideally what would happen, if I would change anything in one place, all target would share that.But the issue comes, that ``ViewControllerinMain.Storyboard` holds the master project "module" so, when I run the child target, it could not run.

like image 522
Saty Avatar asked May 11 '17 09:05

Saty


People also ask

What is aggregate target Xcode?

Xcode defines a special type of target that lets you build a group of targets at once, even if those targets do not depend on each other. An aggregate target has no associated product and no build rules. Instead, an aggregate target depends on each of the targets you want to build together.


1 Answers

You can open Utilities panel, select File inspector tab and mark necessary targets for every file you want to share. See attached image as a reference. targets

like image 149
Alex Avatar answered Sep 24 '22 03:09

Alex