Simple alternate app icons with Xcode 13 and SwiftUI

Overview

XCode 13 Alternate App Icons

Preamble

With the beta of XCode 13 creating alternate app icons is now much simpler and requires much less manual steps than previously. This repo shows how to add alternate app icons and a super simple SwiftUI interface for changing them.

Prepare App Images

Add an iOS App icon asset catalog for each alternate app icon you want to add. Also add an Image Set for each icon. This is necessary because Image will not show an app icon asset.

Populate all the necessary sizes of app icon image in the asset catalog.

Build Settings

Asset Catalog Compiler - Options

Set Include All App Icon Assets to Yes.

Double click on Alternate App Icon Sets and type in the names of your alternate app icons assets, separate with a comma i.e. Green, Blue.

Asset Catalog Compiler - Options

Code

VStack{

    Text("Change App Icon")
        .font(.title)

    HStack{

        Button(action: {
            UIApplication.shared.setAlternateIconName(nil)
        }){
            Image("AppIconImage")
                .cornerRadius(20)
        }

        Button(action: {
            UIApplication.shared.setAlternateIconName("BlueIcon")
        }){
            Image("BlueImage")
                .cornerRadius(20)
        }

        Button(action: {
            UIApplication.shared.setAlternateIconName("GreenIcon")
        }){

            Image("GreenImage")
                .cornerRadius(20)
        }
    }
}

Final result

Change App Icon

You have changed the icon confirmation message

References

XCode 13 Beta Release Notes

Hacking With Swift - How to change your app icon dynamically with setalternateiconname

You might also like...
The easiest way to install and switch between multiple versions of Xcode - with a mouse click.
The easiest way to install and switch between multiple versions of Xcode - with a mouse click.

Xcodes.app The easiest way to install and switch between multiple versions of Xcode. If you're looking for a command-line version of Xcodes.app, try x

Single Webview project for xcode in swift

Single Webview project for xcode in swift An xcode project that with single webview(UIWebView) that opens external URL, for hybrid web app debug or te

App07 - This is part of the 31 days of small Xcode apps for January 2022
App07 - This is part of the 31 days of small Xcode apps for January 2022

App07 This is part of the 31 days of small Xcode apps for January 2022 Multiplic

A package that allows you to easily enable the Xcode canvas to a UIKit view.
A package that allows you to easily enable the Xcode canvas to a UIKit view.

UIViewCanvas This package allows you to enable a SwiftUI Xcode canva to a UIView or a entire ViewController. Why? Run emulator everytime you need to t

A simple SwiftUI Application to demonstrate creation of UI using SwiftUI.
A simple SwiftUI Application to demonstrate creation of UI using SwiftUI.

WatchShop_UI A simple SwiftUI Application to demonstrate creation of UI using SwiftUI. How to run the project ? Fork the project. Run the project usin

SwiftUI Resume - A simple resume writed by swiftUI + Combine
SwiftUI Resume - A simple resume writed by swiftUI + Combine

SwiftUI_Resume a simple "resume" writed by swiftUI + Combine

SwiftUI-Card - Simple card ui designed using SwiftUI
SwiftUI-Card - Simple card ui designed using SwiftUI

SwiftUI - Card Simple card ui designed using SwiftUI Preview

A simple App to Track the status of Covid-19 around the World. Using SwiftUI and GraphQL
A simple App to Track the status of Covid-19 around the World. Using SwiftUI and GraphQL

CovidUI CovidUI is a simple App to Track the status of Covid-19 around the World. This is a simple App I made to track the spread of Covid-19 for me a

Simple app to show usage of SwiftUI and Combine
Simple app to show usage of SwiftUI and Combine

Podcasts Simple app to show usage of SwiftUI and Combine. The app shows a list of podcasts fetched from listennotes and it can be played. Status: Work

Owner
Jake Nelson
Jake Nelson
Icons generator for XCode assets project

SwiftUI-PictGen Icons generator for XCode assets project. Small project in Swift

Laurent Llexti 0 Dec 29, 2021
Weather-app - Created a simple weather app on Xcode using SwiftUI, only shows one location

weather-app Created a simple weather app on Xcode using SwiftUI, only shows one

Rahul Kadiyala 1 Feb 11, 2022
Companion app and XCode extension for adding SwiftUI recipes to your code.

SwiftUI Recipes Companion Free Companion app and XCode extension for adding SwiftUI recipes to your code. Choose from a rich selection of SwiftUI reci

Gordan Glavaš 17 Nov 20, 2022
SwiftUI MovieDB prototype app built with Xcode 11 Beta & macOS 10.15 Catalina

SwiftUI MovieDB iOS 13 App SwiftUI MovieDB prototype app built with Xcode 11 Beta & macOS 10.15 Catalina Requirements macOS 10.15 Catalina Xcode 11 Be

Alfian Losari 297 Dec 17, 2022
A SwiftUI app that reads iOS/watchOS/tvOS device model information from Xcode you select.

iVariant A SwiftUI app that reads iOS/watchOS/tvOS device model information from Xcode you select. Preview License iVariant is licensed under MIT. Cop

Lakr Aream 20 Aug 4, 2022
LiberIOS - LiberIOS used Xcode and SwiftUI

LiberIOS For this test, i have used Xcode and SwiftUI. For the authentication i

null 0 Jan 12, 2022
In this tutorial, you’ll write your very first Core Data application with SwiftUI in Xcode

TodoApp-IOS In this tutorial, you’ll write your very first Core Data application with SwiftUI in Xcode. You’ll see how easy it is to get started with

Noye Samuel 1 Dec 13, 2021
Basic calculator app for iOS devices using Swift 3 and Xcode

iOS Calculator App Basic calculator app for iOS devices using Swift 3 and Xcode. Created for learning purpose. How to use Just download source code an

null 1 Jan 12, 2022
xcode project wrapper around the Elixir TodoApp Desktop app to run on iOS

TodoApp iOS: An iOS Sample App This xcode project wraps the Desktop Sample App to run on an iPhone. How to build & run Install xcode from the app stor

elixir-desktop 43 Nov 7, 2022
The Xcode project for my COSC4355 Weather App

Open WeatherApp_Baji_Adib in Xcode to view An iOS application that provides weather information on the same level of detail as a native weather app Di

null 0 Dec 3, 2021