Sunday, 19 April 2015

Add splash screens instead of LaunchScreen in Xcode 6




Xcode 6 comes with a default Launch Screen for the apps, which loads on app launch and shown to user till app loads fully. Few days back, we are going to upload our new keyboard extension app to iTunes store but we did not set splash screen yet. Since the app is an universal app, so we need to set different splash screen, iPhone (iPhone 4, iPhone 5, iPhone 6) and iPad.
                                                                   As you all know, if familiar with Xcode 6 development, Launch screen adjust itself and personally i am not a big fan of auto layout. So thought of some easier way of setting  different images as splash screen to my project. To set different images as splash screen follow given below steps

1. Remove LaunchScreen.xib from your project.(Optional)

LaunchScreen.xib
LaunchScreen.xib
2. Select your target workspace and under General, delete LaunchScreen file name written in a drop down made in front of Launch Screen File option.

Remove LaunchScreen From drop down
Remove LaunchScreen From drop down  
3. Click on Use Asset Catalog button.

Click on Use Assets Catalog.
Click on Use Assets Catalog.
4. A dialogue will prompt up asking for 'Migrate Launch images to an asset catalog. Click on Migrate.

Migrate dialogue
Migrate dialogue
5. Select Images.xcassets file and there you will see LaunchImage. Select that file if not selected and on right hand side choose different options for your splash file.

Select Image.xcassets
Select Image.xcassets

Choose different options for Launch image
Choose different options for Launch image
6. Drag and drop your images to there desired box and run your project.

7: You can also check which box needs what type of image (i.e. dimension of image required by particular box)

Image dimensions required by selected box
Image dimensions required by selected box 

No comments:
Write comments