diff --git a/ios/.swiftformat b/ios/.swiftformat index f6afcad..bb6b44b 100644 --- a/ios/.swiftformat +++ b/ios/.swiftformat @@ -1,6 +1,4 @@ # SwiftFormat Configuration for Ascently iOS -# Maintains consistent formatting across the project - # File options --exclude build,Pods,DerivedData,.build diff --git a/ios/.swiftlint.yml b/ios/.swiftlint.yml index 1005148..3d85d72 100644 --- a/ios/.swiftlint.yml +++ b/ios/.swiftlint.yml @@ -92,7 +92,6 @@ identifier_name: - DATA_JSON_FILENAME - IMAGES_DIR_NAME - METADATA_FILENAME - # ViewBuilder section functions (SwiftUI convention) - StatusSection - IconDisplaySection - DebugSection diff --git a/ios/Ascently.xcodeproj/project.pbxproj b/ios/Ascently.xcodeproj/project.pbxproj index 0344206..8238c67 100644 --- a/ios/Ascently.xcodeproj/project.pbxproj +++ b/ios/Ascently.xcodeproj/project.pbxproj @@ -466,7 +466,7 @@ CODE_SIGN_ENTITLEMENTS = Ascently/Ascently.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 46; + CURRENT_PROJECT_VERSION = 47; DEVELOPMENT_TEAM = 4BC9Y2LL4B; DRIVERKIT_DEPLOYMENT_TARGET = 24.6; ENABLE_PREVIEWS = YES; @@ -491,7 +491,7 @@ "@executable_path/Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 15.6; - MARKETING_VERSION = 2.7.0; + MARKETING_VERSION = 2.7.1; PRODUCT_BUNDLE_IDENTIFIER = com.atridad.Ascently; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -518,7 +518,7 @@ CODE_SIGN_ENTITLEMENTS = Ascently/Ascently.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 46; + CURRENT_PROJECT_VERSION = 47; DEVELOPMENT_TEAM = 4BC9Y2LL4B; DRIVERKIT_DEPLOYMENT_TARGET = 24.6; ENABLE_PREVIEWS = YES; @@ -543,7 +543,7 @@ "@executable_path/Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 15.6; - MARKETING_VERSION = 2.7.0; + MARKETING_VERSION = 2.7.1; PRODUCT_BUNDLE_IDENTIFIER = com.atridad.Ascently; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -610,7 +610,7 @@ ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground; CODE_SIGN_ENTITLEMENTS = SessionStatusLiveExtension.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 46; + CURRENT_PROJECT_VERSION = 47; DEVELOPMENT_TEAM = 4BC9Y2LL4B; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = SessionStatusLive/Info.plist; @@ -622,7 +622,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 2.7.0; + MARKETING_VERSION = 2.7.1; PRODUCT_BUNDLE_IDENTIFIER = com.atridad.Ascently.SessionStatusLive; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -641,7 +641,7 @@ ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground; CODE_SIGN_ENTITLEMENTS = SessionStatusLiveExtension.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 46; + CURRENT_PROJECT_VERSION = 47; DEVELOPMENT_TEAM = 4BC9Y2LL4B; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = SessionStatusLive/Info.plist; @@ -653,7 +653,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 2.7.0; + MARKETING_VERSION = 2.7.1; PRODUCT_BUNDLE_IDENTIFIER = com.atridad.Ascently.SessionStatusLive; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; diff --git a/ios/Ascently.xcodeproj/project.xcworkspace/xcuserdata/atridad.xcuserdatad/UserInterfaceState.xcuserstate b/ios/Ascently.xcodeproj/project.xcworkspace/xcuserdata/atridad.xcuserdatad/UserInterfaceState.xcuserstate index ee759a6..79778eb 100644 Binary files a/ios/Ascently.xcodeproj/project.xcworkspace/xcuserdata/atridad.xcuserdatad/UserInterfaceState.xcuserstate and b/ios/Ascently.xcodeproj/project.xcworkspace/xcuserdata/atridad.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/ios/Ascently/Assets.xcassets/AscentlyBlueBall.imageset/AscentlyBlueBall.png b/ios/Ascently/Assets.xcassets/AscentlyBlueBall.imageset/AscentlyBlueBall.png new file mode 100644 index 0000000..cecb942 Binary files /dev/null and b/ios/Ascently/Assets.xcassets/AscentlyBlueBall.imageset/AscentlyBlueBall.png differ diff --git a/ios/Ascently/Assets.xcassets/AscentlyBlueBall.imageset/Contents.json b/ios/Ascently/Assets.xcassets/AscentlyBlueBall.imageset/Contents.json new file mode 100644 index 0000000..78635ff --- /dev/null +++ b/ios/Ascently/Assets.xcassets/AscentlyBlueBall.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images": [ + { + "idiom": "universal", + "filename": "AscentlyBlueBall.png", + "scale": "1x" + }, + { + "idiom": "universal", + "scale": "2x" + }, + { + "idiom": "universal", + "scale": "3x" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +} \ No newline at end of file diff --git a/ios/Ascently/Assets.xcassets/AscentlyGreenBall.imageset/AscentlyGreenBall.png b/ios/Ascently/Assets.xcassets/AscentlyGreenBall.imageset/AscentlyGreenBall.png new file mode 100644 index 0000000..64e8a09 Binary files /dev/null and b/ios/Ascently/Assets.xcassets/AscentlyGreenBall.imageset/AscentlyGreenBall.png differ diff --git a/ios/Ascently/Assets.xcassets/AscentlyGreenBall.imageset/Contents.json b/ios/Ascently/Assets.xcassets/AscentlyGreenBall.imageset/Contents.json new file mode 100644 index 0000000..243f3d6 --- /dev/null +++ b/ios/Ascently/Assets.xcassets/AscentlyGreenBall.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images": [ + { + "idiom": "universal", + "filename": "AscentlyGreenBall.png", + "scale": "1x" + }, + { + "idiom": "universal", + "scale": "2x" + }, + { + "idiom": "universal", + "scale": "3x" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +} \ No newline at end of file diff --git a/ios/Ascently/Assets.xcassets/AscentlyRedBall.imageset/AscentlyRedBall.png b/ios/Ascently/Assets.xcassets/AscentlyRedBall.imageset/AscentlyRedBall.png new file mode 100644 index 0000000..83a444e Binary files /dev/null and b/ios/Ascently/Assets.xcassets/AscentlyRedBall.imageset/AscentlyRedBall.png differ diff --git a/ios/Ascently/Assets.xcassets/AscentlyRedBall.imageset/Contents.json b/ios/Ascently/Assets.xcassets/AscentlyRedBall.imageset/Contents.json new file mode 100644 index 0000000..eeb2ce5 --- /dev/null +++ b/ios/Ascently/Assets.xcassets/AscentlyRedBall.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images": [ + { + "idiom": "universal", + "filename": "AscentlyRedBall.png", + "scale": "1x" + }, + { + "idiom": "universal", + "scale": "2x" + }, + { + "idiom": "universal", + "scale": "3x" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +} \ No newline at end of file diff --git a/ios/Ascently/Assets.xcassets/AscentlyYellowBall.imageset/AscentlyYellowBall.png b/ios/Ascently/Assets.xcassets/AscentlyYellowBall.imageset/AscentlyYellowBall.png new file mode 100644 index 0000000..9682362 Binary files /dev/null and b/ios/Ascently/Assets.xcassets/AscentlyYellowBall.imageset/AscentlyYellowBall.png differ diff --git a/ios/Ascently/Assets.xcassets/AscentlyYellowBall.imageset/Contents.json b/ios/Ascently/Assets.xcassets/AscentlyYellowBall.imageset/Contents.json new file mode 100644 index 0000000..c462ca8 --- /dev/null +++ b/ios/Ascently/Assets.xcassets/AscentlyYellowBall.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images": [ + { + "idiom": "universal", + "filename": "AscentlyYellowBall.png", + "scale": "1x" + }, + { + "idiom": "universal", + "scale": "2x" + }, + { + "idiom": "universal", + "scale": "3x" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +} \ No newline at end of file diff --git a/ios/Ascently/Assets.xcassets/AscetlyTriangle1.imageset/AscetlyTriangle1.png b/ios/Ascently/Assets.xcassets/AscetlyTriangle1.imageset/AscetlyTriangle1.png new file mode 100644 index 0000000..bde2a56 Binary files /dev/null and b/ios/Ascently/Assets.xcassets/AscetlyTriangle1.imageset/AscetlyTriangle1.png differ diff --git a/ios/Ascently/Assets.xcassets/AscetlyTriangle1.imageset/Contents.json b/ios/Ascently/Assets.xcassets/AscetlyTriangle1.imageset/Contents.json new file mode 100644 index 0000000..4826f5a --- /dev/null +++ b/ios/Ascently/Assets.xcassets/AscetlyTriangle1.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images": [ + { + "idiom": "universal", + "filename": "AscetlyTriangle1.png", + "scale": "1x" + }, + { + "idiom": "universal", + "scale": "2x" + }, + { + "idiom": "universal", + "scale": "3x" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +} \ No newline at end of file diff --git a/ios/Ascently/Assets.xcassets/AscetlyTriangle2.imageset/AscetlyTriangle2.png b/ios/Ascently/Assets.xcassets/AscetlyTriangle2.imageset/AscetlyTriangle2.png new file mode 100644 index 0000000..544a1e9 Binary files /dev/null and b/ios/Ascently/Assets.xcassets/AscetlyTriangle2.imageset/AscetlyTriangle2.png differ diff --git a/ios/Ascently/Assets.xcassets/AscetlyTriangle2.imageset/Contents.json b/ios/Ascently/Assets.xcassets/AscetlyTriangle2.imageset/Contents.json new file mode 100644 index 0000000..2b1ff7a --- /dev/null +++ b/ios/Ascently/Assets.xcassets/AscetlyTriangle2.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images": [ + { + "idiom": "universal", + "filename": "AscetlyTriangle2.png", + "scale": "1x" + }, + { + "idiom": "universal", + "scale": "2x" + }, + { + "idiom": "universal", + "scale": "3x" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +} \ No newline at end of file diff --git a/ios/Ascently/Views/SettingsView.swift b/ios/Ascently/Views/SettingsView.swift index 903a81c..6d3472c 100644 --- a/ios/Ascently/Views/SettingsView.swift +++ b/ios/Ascently/Views/SettingsView.swift @@ -1,6 +1,7 @@ import HealthKit import MusicKit import SwiftUI +import UIKit import UniformTypeIdentifiers enum SheetType { @@ -28,6 +29,8 @@ struct SettingsView: View { AppearanceSection() + AppIconSection() + DataManagementSection( activeSheet: $activeSheet ) @@ -168,6 +171,61 @@ struct AppearanceSection: View { } } +struct AppIconSection: View { + @State private var currentIcon: String? = UIApplication.shared.alternateIconName + + var body: some View { + Section("App Icon") { + Button(action: { + setIcon(nil) + }) { + HStack { + Image(systemName: "triangle.fill") + Text("Peaks") + .foregroundColor(.primary) + Spacer() + if currentIcon == nil { + Image(systemName: "checkmark") + .foregroundColor(.blue) + } + } + } + + Button(action: { + setIcon("Balls") + }) { + HStack { + Image(systemName: "circle.fill") + Text("Balls") + .foregroundColor(.primary) + Spacer() + if currentIcon == "Balls" { + Image(systemName: "checkmark") + .foregroundColor(.blue) + } + } + } + } + .onAppear { + currentIcon = UIApplication.shared.alternateIconName + } + } + + private func setIcon(_ name: String?) { + guard UIApplication.shared.alternateIconName != name else { return } + + UIApplication.shared.setAlternateIconName(name) { error in + if let error = error { + print("Error setting icon: \(error.localizedDescription)") + } else { + DispatchQueue.main.async { + currentIcon = name + } + } + } + } +} + struct DataManagementSection: View { @EnvironmentObject var dataManager: ClimbingDataManager @EnvironmentObject var themeManager: ThemeManager