Build: Launch Screen Setup
Create a simple launch screen and set a custom app icon for an iOS app.
Target UI
Launch Screen: +---------------------+ | | | [App Icon] | | | | Welcome to App | | | +---------------------+
Launch Screen: +---------------------+ | | | [App Icon] | | | | Welcome to App | | | +---------------------+
import UIKit @main class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // TODO: Setup window and root view controller return true } }
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 } } // LaunchScreen.storyboard setup: // - Add UIImageView centered with image named 'AppIcon' // - Add UILabel below with text 'Welcome to App' // - Use Auto Layout constraints to center and space elements // AppIcon asset catalog: // - Add all required icon sizes for iOS app icon // Project settings: // - Set 'LaunchScreen.storyboard' as the launch screen file // - Set 'AppIcon' as the app icon source
We set up the AppDelegate to create a window and a simple root view controller with a white background. The launch screen is designed in a storyboard named LaunchScreen.storyboard which contains an image view centered with the app icon image and a label below it. Auto Layout constraints ensure the layout adapts to different screen sizes. The app icon images are added to the asset catalog under the AppIcon set, including all required sizes for iOS. Finally, the project settings are configured to use the launch screen storyboard and the app icon set, so the app shows the custom icon and launch screen on startup.
Launch Screen: +---------------------+ | | | [App Icon] | | | | Welcome to App | | | +---------------------+
/* LaunchScreen.storyboard contains a centered image named 'LaunchImage' */ // No code changes to launch screen
Pass the test and this pattern moves unknown