Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone - multiple targets multiple launch images nightmare

I have a project with 2 applications in two flavors each, iPhone and iPad. So, the project has 4 targets. It is obviously not universal.

To easy things, lets call each application AAA and BBB.

The launch images are named like this:

AAA for iPhone

AAA for iPad

The BBB images have the same name structure, with BBB instead of AAA in the name.

I have added this UILaunchImageFile to each plist, like this:

  • AAA for iPhone ... Launch Image (iPhone) = AAAiPhone.png
  • AAA for iPad ... Launch Image (iPad) = AAAiPad.png
  • BBB for iPhone ... Launch Image (iPhone) = BBBiPhone.png
  • BBB for iPad ... Launch Image (iPad) = BBBiPad.png

When I drag the images to the proper place holder on Xcode it goes fine for AAA, but when I do that for BBB it overwrites all AAA images. It appears to be ignoring the info.plist information.

Any clues?

thanks

like image 226
Duck Avatar asked Apr 07 '12 17:04

Duck


4 Answers

It's because the images are renamed to Default.png (or another name same for each target).

You need to do it like this:

Add a entry in your plist for each target. iPad: Launch image (iPad) iPhone Launch image (iPhone)

enter image description here

Use a different string for each target. Place the images with that string to your resource files (also make sure that only the desired images are active in the desired target).

Example:

  • Target 1

    • plist: Launch image (iPad) = AAADefaultiPad
    • Place files: [email protected] and AAADefaultiPad.png
  • Target 2

    • plist: Launch image (iPad) = BBBDefaultiPhone
    • Place files: [email protected] and BBBDefaultiPhone.png

Edit 1: Place the images as you would place a image file into your graphic resources. Do not place it in the image space under Target "Summary".

Works for me pretty well.

like image 101
Jonas Schnelli Avatar answered Nov 15 '22 09:11

Jonas Schnelli


I've written up instructions along with a GitHub project.

https://github.com/brennanMKE/MultipleTargets

There are many steps and details to handle for everything you will want to do to fully support multiple target builds from a single Xcode project. That sample addresses...

  1. Unique app identifier for each build target
  2. Unique launch graphics
  3. Unique app icons
  4. Custom C Flags to manage distinct functionality for each build target
like image 34
Brennan Avatar answered Nov 15 '22 09:11

Brennan


I had some problems regarding multiple targets(iPhone) X multiple launch images/multiple icons when I had to add Retina icons & launch images. To solve this, I had to do do the following in plist:

  • Regarding Icons(low res & retina): In each target, I deleted the entry Icon Files (iOS 5), and added another one (Icon file). Then I modified this row (Icon file) to Icon files (basically, in singular it's type is String, and plural it automatically becomes Array), and added the image files reference, as the following:

info.plist - Icons

  • Regarding the launch images (low res & retina): I did as Jonas suggested, but using the image with retina specs (640 x 960). It works both in low res and hi res.

info.plist - Launch Image with hi-res png file

like image 34
Max Hiroyuki Ueda Avatar answered Nov 15 '22 09:11

Max Hiroyuki Ueda


It is actually very simple:

  1. Define "Launch image" in plist with a string you want to replace "Default" in the file name. Default.png becomes MyAppName.png etc.

  2. Simply create your filenames conforming with default filenames such as:

MyAppName.png

[email protected]

[email protected]

MyAppName-Landscape@2x~ipad.png

MyAppName-Landscape~ipad.png

MyAppName-Portrait@2x~ipad.png

MyAppName-Portrait~ipad.png

like image 33
Tibidabo Avatar answered Nov 15 '22 11:11

Tibidabo