Meshtastic-Apple/Meshtastic/Views/Settings/AppIconPicker.swift
Garth Vander Houwen 40b28b7523
Alternate App icons (#1359)
* Add AppIcon_Dev

Adds a blue developer icon to help tell the dev app apart from the release app.

* Add AppIconPicker and a couple icons

Added a developer icon and an icon representing MSP Mesh

* Dismiss icon picker when icon changes

* Add icon to icon picker menu item

* Replace local mesh icons with Chirpy and add Testflight icon

* AppIconButton shows dark icon when in dark mode

* Update plist to match main

* Only show revelvant icons

* Remove testflight images

* Debug app icon in blue

---------

Co-authored-by: Chase Lau <chase9@mac.com>
2025-08-28 22:54:17 -07:00

25 lines
762 B
Swift

import SwiftUI
struct AppIconPicker: View {
private var idiom: UIUserInterfaceIdiom { UIDevice.current.userInterfaceIdiom }
@Environment(\.managedObjectContext) var context
@Binding var isPresenting: Bool
@State private var didError = false
@State private var errorDetails: String?
var iconNames: [String?: String] = [nil: "Default", "AppIcon_Chirpy": "Chirpy"]
// MARK: View
var body: some View {
List {
Section(header: Text("Icons")) {
ForEach(Array(iconNames.sorted(by: { $0.0 ?? "1" < $1.0 ?? "1"}).enumerated()), id: \.offset) { _, icon in
AppIconButton(iconDescription: .constant(icon.value), iconName: .constant(icon.key), isPresenting: $isPresenting)
}
}
}
}
}
#Preview{
AppIconPicker(isPresenting: .constant(true))
}