I would like to use the launch images from the xcasset; I've already tried some ways but I can't get it works.
I've the standard LaunchImage asset, and the image file are called Default[@2x,...]
. Using [UIImage imageNamed:@"LaunchImage"];
always return nil. I've also tried with @"Default"
, but no results.
If you Just want to use the compiled images separately in your application:
By-default LaunchImage asset would generate following files:
LaunchImage-700-Landscape@2x~ipad.png
LaunchImage-700-Landscape~ipad.png
LaunchImage-700-Portrait@2x~ipad.png
LaunchImage-700-Portrait~ipad.png
To find them use below:
UIImage* image = [UIImage imageNamed:@"LaunchImage-700-Portrait"];
Note: 3 steps required to setup the assets properly are mentioned below. Are you missing anything ?
My Images:
Updating images in Launch Image source:
Drag and drop images in LaunchImage asset: