Today We will learn how to create Multiple Targets in Xcode Project and setting different image.xcassets for them.

Steps:

  1. Create a new Xcode Project (Lets say MultipleTargetInIos).
  2.  Now download tw0 different launch Screen .
  3.  open Assets.xcassets and add one image with name splash.

Screen Shot 2016-09-20 at 12.47.52 AM.png4. Now add one new xcasets in your project. Go to File- New- Resource-  AssetCatalog

Screen Shot 2016-09-20 at 12.14.04 AM.png5. Now rename this image xcasets to NewTarget.

  1. Now go to Targets and right click on the target and  click on duplicate.

Screen Shot 2016-09-20 at 12.16.34 AM.png7.  Now a new target will be created . Now rename this target to NewTarget.

Screen Shot 2016-09-20 at 12.16.50 AM.png

Screen Shot 2016-09-20 at 12.17.21 AM.png8. A plist will be also created with the name  MultipleTargetInIoscopy.plist. Just change the name of Plist to NewTarget.plist.  Go to Bundle Identifier and change it with the name com.Nilesh.NewTarget.

  1.  Now go to NewTarget and select the choose plist option and choose the NewTarget.plist.

Screen Shot 2016-09-20 at 12.18.52 AM.png10.  Now we will have to manage the schemas.

screen-shot-2016-09-20-at-12-18-02-am

Screen Shot 2016-09-20 at 12.18.12 AM.pngWe will rename the target to NewTarget.

Screen Shot 2016-09-20 at 12.18.44 AM.png11. Now just click on both image xcassests and make sure that the target for them is thier desired target.

screen-shot-2016-09-20-at-1-06-36-amscreen-shot-2016-09-20-at-1-06-44-am12. Now clean and run the project by selecting different targets. You will see different launch Screen in both of them.

 

Please do share your Views.

You can download the whole source code from here.

Enjoy Coding.  🙂

Advertisements