A SwiftUI view for presenting and changing iOS app icons effortlessly.
AppIconView
is a SwiftUI view tailored to showcase the available app icons in a list. It integrates seamlessly with the AppIcon utility, providing an intuitive interface for users to select and change app icons on the fly.
You can add AppIconView
and AppIcon
as dependencies to your project using Swift Package Manager by adding them to the dependencies value of your Package.swift.
dependencies: [
.package(url: "https://github.com/kevinhermawan/AppIcon.git", .upToNextMajor(from: "2.0.0")),
.package(url: "https://github.com/kevinhermawan/AppIconView.git", .upToNextMajor(from: "2.0.0"))
]
Alternatively, in Xcode:
- Open your project in Xcode.
- Click on
File
->Swift Packages
->Add Package Dependency...
- Enter the repository URL:
https://github.com/kevinhermawan/AppIconView.git
- Choose the version you want to add. You probably want to add the latest version.
- Ensure both
AppIconView
andAppIcon
are selected in the list of libraries or modules to add. - Click
Add Package
.
import AppIcon
import AppIconView
struct ContentView: View {
@State private var currentAppIcon: Icon? = AppIcon.current
var body: some View {
NavigationView {
AppIconView(current: $currentAppIcon, defined: AppIcon.defined)
.navigationTitle("App Icon")
}
}
}
For a detailed guide on setting up alternate app icons and the necessary Info.plist
configurations, refer to the official Apple documentation on "Configuring Your App to Use Alternate App Icons".