From f7aeeb444822fea0191f8afcec78f9d2ee3b645f Mon Sep 17 00:00:00 2001 From: Mike Simms Date: Sun, 7 Jul 2024 18:32:53 -0400 Subject: [PATCH] Fix XCode deprecation warnings. --- .../project.pbxproj | 22 +++++++++++---- Watch App/ActivityView.swift | 4 +-- iPhone App/ActivityPreferencesView.swift | 28 +++++++++---------- iPhone App/ActivityView.swift | 2 +- iPhone App/EditIntervalSessionView.swift | 8 +++--- iPhone App/EditPacePlanView.swift | 8 +++--- iPhone App/HistoryDetailsView.swift | 4 +-- iPhone App/ProfileView.swift | 6 ++-- iPhone App/SensorsView.swift | 2 +- iPhone App/SettingsView.swift | 22 +++++++-------- iPhone App/WorkoutsView.swift | 8 +++--- 11 files changed, 63 insertions(+), 51 deletions(-) diff --git a/OpenWorkoutTracker-Swift.xcodeproj/project.pbxproj b/OpenWorkoutTracker-Swift.xcodeproj/project.pbxproj index 73e0cbf..36809ab 100644 --- a/OpenWorkoutTracker-Swift.xcodeproj/project.pbxproj +++ b/OpenWorkoutTracker-Swift.xcodeproj/project.pbxproj @@ -302,6 +302,8 @@ 27E60914292D13DA00401901 /* ActivityComplications.intentdefinition in Sources */ = {isa = PBXBuildFile; fileRef = 27E6090F292D13D900401901 /* ActivityComplications.intentdefinition */; }; 27E60917292D13DA00401901 /* ActivityComplicationsExtension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = 27E60909292D13D900401901 /* ActivityComplicationsExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; 27E6091D292D4EEC00401901 /* ActivityVM.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27E6091C292D4EEC00401901 /* ActivityVM.swift */; }; + 27F59AEA2C1763BE00AE1B6D /* HeartRatePeripheralManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27F59AE62C1250FC00AE1B6D /* HeartRatePeripheralManager.swift */; }; + 27F59AEB2C17675F00AE1B6D /* HeartRatePeripheralManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27F59AE62C1250FC00AE1B6D /* HeartRatePeripheralManager.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -709,6 +711,7 @@ 27E60910292D13DA00401901 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 27E60912292D13DA00401901 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 27E6091C292D4EEC00401901 /* ActivityVM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActivityVM.swift; sourceTree = ""; }; + 27F59AE62C1250FC00AE1B6D /* HeartRatePeripheralManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = HeartRatePeripheralManager.swift; path = LibBluetooth/mac/Source_Swift/HeartRatePeripheralManager.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -1076,6 +1079,7 @@ 2740E10D28EB5B4C00293B71 /* CyclingCadenceService.swift */, 2740E07928E5DEC500293B71 /* CyclingPowerService.swift */, 2704225A2905DC6300FD02D4 /* CyclingRadarService.swift */, + 27F59AE62C1250FC00AE1B6D /* HeartRatePeripheralManager.swift */, 2740E07728E5DEC500293B71 /* HeartRateService.swift */, ); name = LibBluetooth; @@ -1482,7 +1486,7 @@ attributes = { BuildIndependentTargetsInParallel = 1; LastSwiftUpdateCheck = 1410; - LastUpgradeCheck = 1500; + LastUpgradeCheck = 1540; TargetAttributes = { 278D92BF28E38F17003B077C = { CreatedOnToolsVersion = 14.0; @@ -1684,6 +1688,7 @@ 2740DFD628E460E200293B71 /* FtpCalculator.cpp in Sources */, 27091AC52A65BC7A0013AD48 /* SensorChartView.swift in Sources */, 2740DFD728E460E200293B71 /* UnitMgr.cpp in Sources */, + 27F59AEA2C1763BE00AE1B6D /* HeartRatePeripheralManager.swift in Sources */, 2740E0A528E644EE00293B71 /* SensorMgr.swift in Sources */, 2740DFE328E460E200293B71 /* OpenWaterSwim.cpp in Sources */, 2740E03428E4CE1C00293B71 /* GpxFileWriter.cpp in Sources */, @@ -1854,6 +1859,7 @@ 2740E0D428E7028C00293B71 /* Treadmill.cpp in Sources */, 2740E0D728E7028C00293B71 /* ActivityMgr.mm in Sources */, 2740E0EA28E702AD00293B71 /* TcxFileWriter.cpp in Sources */, + 27F59AEB2C17675F00AE1B6D /* HeartRatePeripheralManager.swift in Sources */, 2740E0B828E7028C00293B71 /* GForceAnalyzerFactory.cpp in Sources */, 2740E0A628E644EE00293B71 /* SensorMgr.swift in Sources */, 2740E0C328E7028C00293B71 /* BikePlanGenerator.cpp in Sources */, @@ -1985,6 +1991,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; @@ -2033,11 +2040,13 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 17.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + WATCHOS_DEPLOYMENT_TARGET = 10.0; }; name = Debug; }; @@ -2045,6 +2054,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; @@ -2087,10 +2097,12 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 17.0; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-O"; + WATCHOS_DEPLOYMENT_TARGET = 10.0; }; name = Release; }; @@ -2126,7 +2138,7 @@ SWIFT_OBJC_BRIDGING_HEADER = "Bridging-Header.h"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 4; - WATCHOS_DEPLOYMENT_TARGET = 9.1; + WATCHOS_DEPLOYMENT_TARGET = 10.0; }; name = Debug; }; @@ -2163,7 +2175,7 @@ SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 4; VALIDATE_PRODUCT = YES; - WATCHOS_DEPLOYMENT_TARGET = 9.1; + WATCHOS_DEPLOYMENT_TARGET = 10.0; }; name = Release; }; @@ -2196,7 +2208,7 @@ INFOPLIST_KEY_UILaunchScreen_Generation = YES; INFOPLIST_KEY_UILaunchStoryboardName = "Launch Screen.storyboard"; INFOPLIST_KEY_UISupportedInterfaceOrientations = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown"; - IPHONEOS_DEPLOYMENT_TARGET = 16.0; + IPHONEOS_DEPLOYMENT_TARGET = 17.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -2242,7 +2254,7 @@ INFOPLIST_KEY_UILaunchScreen_Generation = YES; INFOPLIST_KEY_UILaunchStoryboardName = "Launch Screen.storyboard"; INFOPLIST_KEY_UISupportedInterfaceOrientations = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown"; - IPHONEOS_DEPLOYMENT_TARGET = 16.0; + IPHONEOS_DEPLOYMENT_TARGET = 17.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", diff --git a/Watch App/ActivityView.swift b/Watch App/ActivityView.swift index 4671a92..c35b80d 100644 --- a/Watch App/ActivityView.swift +++ b/Watch App/ActivityView.swift @@ -400,9 +400,9 @@ struct ActivityView: View { } .focusable() .digitalCrownRotation(self.$crownValue, from: MIN_CROWN_VALUE, through: MAX_CROWN_VALUE, by: -1, sensitivity: .low, isContinuous: true, isHapticFeedbackEnabled: true) - .onChange(of: self.crownValue) { output in + .onChange(of: self.crownValue) { if Preferences.watchTurnCrownToStartStopActivity() { - if output >= MIN_CROWN_VALUE + 4.0 && output < MIN_CROWN_VALUE + 5.0 { + if self.crownValue >= MIN_CROWN_VALUE + 4.0 && self.crownValue < MIN_CROWN_VALUE + 5.0 { self.handleStartStopPauseAction() } } diff --git a/iPhone App/ActivityPreferencesView.swift b/iPhone App/ActivityPreferencesView.swift index 90e1d49..22ef09f 100644 --- a/iPhone App/ActivityPreferencesView.swift +++ b/iPhone App/ActivityPreferencesView.swift @@ -55,20 +55,20 @@ struct ActivityPreferencesView: View { Text("Default Layout") .bold() Toggle("Screen Auto-Locking", isOn: self.$screenAutoLocking) - .onChange(of: screenAutoLocking) { value in - ActivityPreferences.setScreenAutoLocking(activityType: self.activityType, value: value) + .onChange(of: screenAutoLocking) { + ActivityPreferences.setScreenAutoLocking(activityType: self.activityType, value: self.screenAutoLocking) } Toggle("Allow Screen Presses During Activity", isOn: self.$allowScreenPresses) - .onChange(of: allowScreenPresses) { value in - ActivityPreferences.setAllowScreenPressesDuringActivity(activityType: self.activityType, value: value) + .onChange(of: allowScreenPresses) { + ActivityPreferences.setAllowScreenPressesDuringActivity(activityType: self.activityType, value: self.allowScreenPresses) } Toggle("Countdown Timer", isOn: self.$countdownTimer) - .onChange(of: countdownTimer) { value in - ActivityPreferences.setCountdown(activityType: self.activityType, value: value) + .onChange(of: countdownTimer) { + ActivityPreferences.setCountdown(activityType: self.activityType, value: self.countdownTimer) } Toggle("Show Heart Rate as Percentage", isOn: self.$showHeartRateAsPercentage) - .onChange(of: showHeartRateAsPercentage) { value in - ActivityPreferences.setShowHeartRatePercent(activityType: self.activityType, value: value) + .onChange(of: showHeartRateAsPercentage) { + ActivityPreferences.setShowHeartRatePercent(activityType: self.activityType, value: self.showHeartRateAsPercentage) } } Group() { @@ -124,12 +124,12 @@ struct ActivityPreferencesView: View { Text("Sounds") .bold() Toggle("Start/Stop Beep", isOn: self.$startStopBeep) - .onChange(of: startStopBeep) { value in - ActivityPreferences.setStartStopBeepEnabled(activityType: self.activityType, value: value) + .onChange(of: self.startStopBeep) { + ActivityPreferences.setStartStopBeepEnabled(activityType: self.activityType, value: self.startStopBeep) } Toggle("Split Beep", isOn: self.$splitBeep) - .onChange(of: splitBeep) { value in - ActivityPreferences.setSplitBeepEnabled(activityType: self.activityType, value: value) + .onChange(of: splitBeep) { + ActivityPreferences.setSplitBeepEnabled(activityType: self.activityType, value: self.splitBeep) } } Group() { @@ -142,7 +142,7 @@ struct ActivityPreferencesView: View { .keyboardType(.decimalPad) .multilineTextAlignment(.trailing) .fixedSize() - .onChange(of: self.horizontalAccuracy.value) { value in + .onChange(of: self.horizontalAccuracy.value) { } Text("Meters") } @@ -153,7 +153,7 @@ struct ActivityPreferencesView: View { .keyboardType(.decimalPad) .multilineTextAlignment(.trailing) .fixedSize() - .onChange(of: self.verticalAccuracy.value) { value in + .onChange(of: self.verticalAccuracy.value) { } Text("Meters") } diff --git a/iPhone App/ActivityView.swift b/iPhone App/ActivityView.swift index 6a7eb4b..88e3fa3 100644 --- a/iPhone App/ActivityView.swift +++ b/iPhone App/ActivityView.swift @@ -389,7 +389,7 @@ struct ActivityView: View { .keyboardType(.decimalPad) .multilineTextAlignment(.trailing) .fixedSize() - .onChange(of: self.additionalWeight.value) { value in + .onChange(of: self.additionalWeight.value) { } HStack() { diff --git a/iPhone App/EditIntervalSessionView.swift b/iPhone App/EditIntervalSessionView.swift index 19dcc3a..21743cd 100644 --- a/iPhone App/EditIntervalSessionView.swift +++ b/iPhone App/EditIntervalSessionView.swift @@ -47,8 +47,8 @@ struct EditIntervalSessionView: View { .font(.system(size: 24)) .bold() TextField("Name", text: self.$tempName) - .onChange(of: self.tempName) { value in - self.tempSession.name = value + .onChange(of: self.tempName) { + self.tempSession.name = self.tempName } } .padding(SIDE_INSETS) @@ -79,8 +79,8 @@ struct EditIntervalSessionView: View { .bold() TextField("Description", text: self.$tempDescription, axis: .vertical) .lineLimit(2...10) - .onChange(of: self.tempDescription) { value in - self.tempSession.description = value + .onChange(of: self.tempDescription) { + self.tempSession.description = self.tempDescription } } .padding(SIDE_INSETS) diff --git a/iPhone App/EditPacePlanView.swift b/iPhone App/EditPacePlanView.swift index 0ab10dd..3e90bf6 100644 --- a/iPhone App/EditPacePlanView.swift +++ b/iPhone App/EditPacePlanView.swift @@ -64,7 +64,7 @@ struct EditPacePlanView: View { .font(.system(size: 24)) .bold() TextField("Name", text: self.$tempName) - .onChange(of: self.tempName) { value in + .onChange(of: self.tempName) { self.tempPacePlan.name = tempName } } @@ -76,7 +76,7 @@ struct EditPacePlanView: View { .bold() TextField("Description", text: self.$tempDescription, axis: .vertical) .lineLimit(2...10) - .onChange(of: self.tempDescription) { value in + .onChange(of: self.tempDescription) { self.tempPacePlan.description = tempDescription } } @@ -92,7 +92,7 @@ struct EditPacePlanView: View { HStack() { TextField("Distance", text: self.$distanceEntry.value) .keyboardType(.decimalPad) - .onChange(of: self.distanceEntry.value) { value in + .onChange(of: self.distanceEntry.value) { if let value = Double(self.distanceEntry.value) { self.tempPacePlan.distance = value } @@ -123,7 +123,7 @@ struct EditPacePlanView: View { .bold() HStack() { TextField("Time (hh:mm:ss)", text: self.$timeStr) - .onChange(of: self.timeStr) { value in + .onChange(of: self.timeStr) { var hours: Int = 0 var mins: Int = 0 var secs: Int = 0 diff --git a/iPhone App/HistoryDetailsView.swift b/iPhone App/HistoryDetailsView.swift index d6bca11..95fda4f 100644 --- a/iPhone App/HistoryDetailsView.swift +++ b/iPhone App/HistoryDetailsView.swift @@ -142,7 +142,7 @@ struct HistoryDetailsView: View { // Name HStack() { TextField("Name", text: self.$activityVM.name) - .onChange(of: self.activityVM.name) { value in + .onChange(of: self.activityVM.name) { self.showingUpdateNameError = !self.activityVM.updateActivityName() } .lineLimit(2...4) @@ -156,7 +156,7 @@ struct HistoryDetailsView: View { // Description HStack() { TextField("Description", text: self.$activityVM.description, axis: .vertical) - .onChange(of: self.activityVM.description) { value in + .onChange(of: self.activityVM.description) { self.showingUpdateDescriptionError = !self.activityVM.updateActivityDescription() } .lineLimit(2...10) diff --git a/iPhone App/ProfileView.swift b/iPhone App/ProfileView.swift index f37733f..83f537e 100644 --- a/iPhone App/ProfileView.swift +++ b/iPhone App/ProfileView.swift @@ -67,7 +67,7 @@ struct ProfileView: View { if self.showsDatePicker { DatePicker("", selection: self.$birthdate, displayedComponents: .date) .datePickerStyle(.graphical) - .onChange(of: self.birthdate) { value in + .onChange(of: self.birthdate) { Preferences.setBirthDate(value: time_t(self.birthdate.timeIntervalSince1970)) CommonApp.shared.updateUserProfile() self.showingApiError = !ApiClient.shared.sendUpdatedUserBirthDate(timestamp: Date()) @@ -84,7 +84,7 @@ struct ProfileView: View { .keyboardType(.decimalPad) .multilineTextAlignment(.trailing) .fixedSize() - .onChange(of: self.height.value) { value in + .onChange(of: self.height.value) { if let value = Double(self.height.value) { ProfileVM.setHeight(height: value) self.showingApiError = !ApiClient.shared.sendUpdatedUserHeight(timestamp: Date()) @@ -108,7 +108,7 @@ struct ProfileView: View { .keyboardType(.decimalPad) .multilineTextAlignment(.trailing) .fixedSize() - .onChange(of: self.weight.value) { value in + .onChange(of: self.weight.value) { if let value = Double(self.weight.value) { ProfileVM.setWeight(weight: value) self.showingApiError = !ApiClient.shared.sendUpdatedUserWeight(timestamp: Date()) diff --git a/iPhone App/SensorsView.swift b/iPhone App/SensorsView.swift index f0407e0..1633a62 100644 --- a/iPhone App/SensorsView.swift +++ b/iPhone App/SensorsView.swift @@ -19,7 +19,7 @@ struct SensorsView: View { .padding(INFO_INSETS) Toggle("Scan for compatible sensors", isOn: self.$shouldScan) - .onChange(of: self.shouldScan) { value in + .onChange(of: self.shouldScan) { Preferences.setScanForSensors(value: self.shouldScan) if self.shouldScan { SensorMgr.shared.startSensors(usableSensors: []) diff --git a/iPhone App/SettingsView.swift b/iPhone App/SettingsView.swift index 007182b..e882803 100644 --- a/iPhone App/SettingsView.swift +++ b/iPhone App/SettingsView.swift @@ -35,8 +35,8 @@ struct SettingsView: View { .bold() VStack(alignment: .center) { Toggle("Metric", isOn: self.$preferMetric) - .onChange(of: self.preferMetric) { value in - Preferences.setPreferredUnitSystem(system: value ? UNIT_SYSTEM_METRIC : UNIT_SYSTEM_US_CUSTOMARY) + .onChange(of: self.preferMetric) { + Preferences.setPreferredUnitSystem(system: self.preferMetric ? UNIT_SYSTEM_METRIC : UNIT_SYSTEM_US_CUSTOMARY) SetPreferredUnitSystem(Preferences.preferredUnitSystem()) // Update the backend } } @@ -47,11 +47,11 @@ struct SettingsView: View { .bold() VStack(alignment: .center) { Toggle("Read Activities From HealthKit", isOn: self.$readActivitiesFromHealthKit) - .onChange(of: self.readActivitiesFromHealthKit) { value in + .onChange(of: self.readActivitiesFromHealthKit) { Preferences.setWillIntegrateHealthKitActivities(value: self.readActivitiesFromHealthKit) } Toggle("Hide Duplicate Activities", isOn: self.$hideDuplicateActivities) - .onChange(of: self.hideDuplicateActivities) { value in + .onChange(of: self.hideDuplicateActivities) { Preferences.setHideHealthKitDuplicates(value: self.hideDuplicateActivities) } } @@ -62,7 +62,7 @@ struct SettingsView: View { .bold() VStack(alignment: .center) { Toggle("Auto Save Files to iCloud Drive", isOn: self.$autoSaveActivitiesToICloudDrive) - .onChange(of: self.autoSaveActivitiesToICloudDrive) { value in + .onChange(of: self.autoSaveActivitiesToICloudDrive) { Preferences.setAutoSaveToICloudDrive(value: self.autoSaveActivitiesToICloudDrive) } } @@ -73,7 +73,7 @@ struct SettingsView: View { .bold() VStack(alignment: .center) { Toggle("Enabled", isOn: self.$broadcastEnabled) - .onChange(of: self.broadcastEnabled) { value in + .onChange(of: self.broadcastEnabled) { Preferences.setBroadcastToServer(value: self.broadcastEnabled) let _ = self.apiClient.checkLoginStatus() } @@ -84,7 +84,7 @@ struct SettingsView: View { .keyboardType(.decimalPad) .multilineTextAlignment(.trailing) .fixedSize() - .onChange(of: self.updateRate.value) { value in + .onChange(of: self.updateRate.value) { if let value = Int(self.updateRate.value) { Preferences.setBroadcastRate(value: value) } else { @@ -93,8 +93,8 @@ struct SettingsView: View { Text(" seconds") } Toggle("Use HTTPS", isOn: self.$useHttps) - .onChange(of: self.useHttps) { value in - Preferences.setBroadcastProtocol(value: value ? "https" : "http") + .onChange(of: self.useHttps) { + Preferences.setBroadcastProtocol(value: self.useHttps ? "https" : "http") } HStack() { Text("Broadcast Server") @@ -102,12 +102,12 @@ struct SettingsView: View { TextField("Server", text: self.$broadcastServer) .keyboardType(.URL) .multilineTextAlignment(.trailing) - .onChange(of: self.broadcastServer) { value in + .onChange(of: self.broadcastServer) { Preferences.setBroadcastHostName(value: self.broadcastServer) } } Toggle("Show Broadcast Icon", isOn: self.$showBroadcastIcon) - .onChange(of: self.showBroadcastIcon) { value in + .onChange(of: self.showBroadcastIcon) { Preferences.setBroadcastShowIcon(value: self.showBroadcastIcon) } } diff --git a/iPhone App/WorkoutsView.swift b/iPhone App/WorkoutsView.swift index 2b28514..6df6601 100644 --- a/iPhone App/WorkoutsView.swift +++ b/iPhone App/WorkoutsView.swift @@ -120,7 +120,7 @@ struct WorkoutsView: View { if self.showsDatePicker { DatePicker("", selection: self.$goalDate, displayedComponents: .date) .datePickerStyle(.graphical) - .onChange(of: self.goalDate) { value in + .onChange(of: self.goalDate) { Preferences.setWorkoutGoalDate(value: time_t(self.goalDate.timeIntervalSince1970)) } } @@ -152,7 +152,7 @@ struct WorkoutsView: View { // Other Preferences Toggle("Cycling", isOn: self.$allowCyclingWorkouts) - .onChange(of: self.allowCyclingWorkouts) { value in + .onChange(of: self.allowCyclingWorkouts) { // Save Preferences.setWorkoutsCanIncludeBikeRides(value: self.allowCyclingWorkouts) @@ -163,7 +163,7 @@ struct WorkoutsView: View { .bold() .padding(5) Toggle("Pool Swims", isOn: self.$allowPoolSwimWorkouts) - .onChange(of: self.allowPoolSwimWorkouts) { value in + .onChange(of: self.allowPoolSwimWorkouts) { // Save Preferences.setWorkoutsCanIncludePoolSwims(value: self.allowPoolSwimWorkouts) @@ -174,7 +174,7 @@ struct WorkoutsView: View { .bold() .padding(5) Toggle("Open Water Swims", isOn: self.$allowOpenWaterSwims) - .onChange(of: self.allowOpenWaterSwims) { value in + .onChange(of: self.allowOpenWaterSwims) { // Save Preferences.setWorkoutsCanIncludeOpenWaterSwims(value: self.allowOpenWaterSwims)