The launch screen exceeds the memory limit
While working with recent versions of Xcode, developers may encounter warnings such as “The launch screen exceeds the memory limit and may not display during app launch. Use images requiring less space.” Additionally, some may notice that images added to the launch screen are not visible.
Above issues arise from not adhering to Apple’s Human Interface Guidelines for Launch Screens.
Lets understand what is the Launch Screen
The system displays your launch screen the moment your app or game starts and quickly replaces it with your first screen, giving people the impression that your experience is fast and responsive.
Some Key Points from Apple’s Guidelines
- Design Consistency: Design a launch screen that closely resembles the first screen of your app.
- Avoid Text: Refrain from including text on your launch screen since it cannot be localized.
- No Advertising: The launch screen is not intended for logos or other branding elements. Its purpose is to enhance the user experience.
Implementing a Launch Screen in Xcode 15
Create a Launch Screen Storyboard:
In Xcode 15, the default launch screen storyboard is not provided. You need to add it manually.
Navigate to New File > User Interface > Launch Screen
.
Configure Launch Screen in Target Settings:
Select the General
tab in your target settings.
In the “App Icons and Launch Images” section, choose the new launch screen storyboard from the Launch Screen storyboard
pop-up menu.
Customizing the Storyboard:
The storyboard will include two default labels: one at the center with the project name, and another at the bottom, we can use it for copyright text (e.g., “Copyright © 2023 Virgin Active UK. All rights reserved.”).
To match the app theme, you can add a background color to the view.
Thats it, but If you wish to display an image or app logo on the launch screen without triggering the aforementioned warnings, follow these steps:
Adding Images and Text:
- Although you can add images and logos, it is advisable to keep the design minimal to ensure the best user experience and avoid delays.
- Both JPEG and PNG image formats are supported, but keep their sizes minimal (around 1 MB) to avoid memory limit warnings.
- Use ‘Single Scale’ instead of ‘Individual Scales’ and set ‘Appearances’ to “Any Light Dark” to support both modes.
Testing Dark and Light Modes:
In the simulator, go to the “Settings” app, scroll down and tap “Developer”, and toggle the “Dark Appearance” option to test different modes.
Thank you!