Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I use the Launch Images from an Asset Catalogue in the Launch Storyboard?

I do need to support both storyboard-based launch screens and 'traditional' launch images in a project.

Adding a Launch Screen storyboard with an UIImageView pointing to the launch screen seemed like a straightforward way of doing so. Yet, Interface Builder cannot locate the launch image and cannot display it at all.

As all sizes differ also in content, will the storyboard even select the right image?

Reconstructing the images with size classes and constraints is not quite possible, so

TL;DR: How do use a Launch Storyboard that uses the corresponding images from the set of launch screen images?

like image 931
Tobi Nary Avatar asked Mar 01 '16 08:03

Tobi Nary


1 Answers

I know this is an old question. Short answer is "you can't", but there is a workaround.

Here is how I do it:

Do not add the images you want to use to an asset catalog. Instead, add the images directly to your project and make sure you have them included in the target. You have to go back to the old "image.png", "[email protected]", "[email protected]" naming convention in order to supply different images for different screen sizes.

Hope that helps anyone who comes across this.

Adding images to target Set image to ImageView in LaunchScreen storyboard $$$

like image 50
Jordan Avatar answered Nov 15 '22 19:11

Jordan