0
0
iOS Swiftmobile~5 mins

App icon and launch screen in iOS Swift

Choose your learning style9 modes available
Introduction

App icons and launch screens help users recognize your app and give a smooth start experience.

When you want your app to have a unique picture on the home screen.
When you want to show a simple image or logo while your app is loading.
When you want to make your app look professional and polished.
When you want to improve user experience by avoiding a blank screen at startup.
Syntax
iOS Swift
1. Add app icon images in Assets.xcassets > AppIcon.
2. Add launch screen storyboard file (LaunchScreen.storyboard).
3. Set launch screen in project settings under General > Launch Screen File.
App icons must be square images in multiple sizes for different devices.
Launch screens use storyboards or XIB files, not static images.
Examples
This is the main app icon used in the App Store.
iOS Swift
Add 1024x1024 PNG image named AppIcon in Assets.xcassets for App Store icon.
This storyboard shows your logo while the app loads.
iOS Swift
Create LaunchScreen.storyboard with an ImageView showing your logo centered.
This tells iOS to use your storyboard as the launch screen.
iOS Swift
In Xcode project settings, set 'Launch Screen File' to 'LaunchScreen'.
Sample App

This simple app shows a white screen after the launch screen. The launch screen and app icon are set in the project settings and assets.

iOS Swift
import UIKit

@main
class AppDelegate: UIResponder, UIApplicationDelegate {

  var window: UIWindow?

  func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
    window = UIWindow(frame: UIScreen.main.bounds)
    let viewController = UIViewController()
    viewController.view.backgroundColor = .white
    window?.rootViewController = viewController
    window?.makeKeyAndVisible()
    return true
  }
}
OutputSuccess
Important Notes
Tip: Use vector or high-resolution images for app icons to keep them sharp on all devices.
Remember: The launch screen should be simple and fast to load to avoid delays.
Accessibility: Ensure your launch screen has good contrast and no flashing content.
Summary

App icons are the images users see on their home screen and in the App Store.

Launch screens show a simple image or layout while your app is starting.

Set app icons in Assets.xcassets and launch screens with a storyboard file in project settings.