The world of mobile apps is changing. Companies are finding new ways to keep the app users engaged with variety of UI patterns, UX styles, and so on. Mobile apps are no longer limited to just functionality. The whole mobile app development landscape has changed. Not only the mobile app developers but, the app users have also started giving importance to aesthetics and how the app looks. User experience is given equal if not more weightage for the app’s success.
One such aspect of a great UI/UX is the dynamic changing of the logo without having to re-install the app. You might have noticed that some iOS Apps change their logo dynamically to mark certain events.
Example:
- When you purchase a Zomato Gold, the app asks whether you want to change the app logo and if you say yes, it changes without you having to install the app again.
- During Christmas, many apps change their logo to resonate the holiday season
Have you ever wondered, how these iOS apps are changing the logos without and developer interaction and even the app user interaction?
The answer lies below.
Step 1: Create Alternate Icons
- Design your alternate logos (e.g., Christmas themed).
- Add them to your Xcode project's Asset Catalog as iOS App Icons.
- Ensure they have the required sizes for different devices.
Step 2: Configure Info.plist
- Open your app's Info.plist file.
- Add a new key CFBundleIcons (if not present). This defines your app's primary icon.
- Add another key CFBundleAlternateIcons . This will hold information about your alternate icons.
- Under CFBundleAlternateIcons , create a dictionary for each alternate icon
- Key: A unique identifier (string) for this icon.
- Value: The filename (string) of the alternate icon image in your Asset Catalog.
Code for Switching Icons (Swift)
Swift
func setAlternateIcon(name: String) {
UIApplication.shared.setAlternateIconName(name) { error in if let error = error {
// Handle error (e.g., icon not found) print(error.localizedDescription)
} else {
// Icon switch successful
}
}
}
Explanation:
- This function takes the identifier string of the desired alternate icon as input.
- UIApplication.shared.setAlternateIconName attempts to switch the app's icon.
- The completion handler receives any errors encountered during the process.
[
Develop an iPhone app for your business today.Contact us now!!
Contact us
Step 3: Triggering the Icon Change:
- Decide on the event that triggers the icon change (e.g., user preference, holiday detection).
- Upon the event, call the setAlternateIcon function with the appropriate identifier.
Step 4: App Store Upload and Settings:
- Alternate icons are included in your app binary when you submit it to the App Store. No special configuration is needed for upload.
- App Store screenshots and previews should reflect the default app icon.
Important Notes:
- Users need to restart their app or home screen to see the icon change reflected.
- Apple has guidelines for using alternate icons. Avoid misleading users or using them for deceptive purposes.
Conclusion
Dynamic changing of the logo in an iOS app is a way of connecting with the app users and making the entire event special. It gives users a sense of engagement and sometimes superiority compared to the other app users. Exploit this feature whenever you set out to develop a mobile app. A top iPhone app development company can know the ways to engage more further and make it further more dynamic. Connect today
