2025-08-28 22:54:17 -07:00
|
|
|
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?
|
2025-09-18 13:19:45 -07:00
|
|
|
var iconNames: [String?: String] = [nil: "Default", "AppIcon_MPowered": "Meshtastic Powered", "AppIcon_Chirpy": "Chirpy", "AppIcon_Ham": "Ham"]
|
2025-08-28 22:54:17 -07:00
|
|
|
|
|
|
|
|
// MARK: View
|
|
|
|
|
var body: some View {
|
|
|
|
|
List {
|
|
|
|
|
Section(header: Text("Icons")) {
|
2025-09-18 13:19:45 -07:00
|
|
|
ForEach(Array(iconNames.enumerated()), id: \.offset) { _, icon in
|
2025-08-28 22:54:17 -07:00
|
|
|
AppIconButton(iconDescription: .constant(icon.value), iconName: .constant(icon.key), isPresenting: $isPresenting)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#Preview{
|
|
|
|
|
AppIconPicker(isPresenting: .constant(true))
|
|
|
|
|
}
|