Skip to content

Commit

Permalink
Fix XCode deprecation warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
msimms committed Jul 7, 2024
1 parent e189035 commit f7aeeb4
Show file tree
Hide file tree
Showing 11 changed files with 63 additions and 51 deletions.
22 changes: 17 additions & 5 deletions OpenWorkoutTracker-Swift.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -709,6 +711,7 @@
27E60910292D13DA00401901 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
27E60912292D13DA00401901 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
27E6091C292D4EEC00401901 /* ActivityVM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActivityVM.swift; sourceTree = "<group>"; };
27F59AE62C1250FC00AE1B6D /* HeartRatePeripheralManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = HeartRatePeripheralManager.swift; path = LibBluetooth/mac/Source_Swift/HeartRatePeripheralManager.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -1076,6 +1079,7 @@
2740E10D28EB5B4C00293B71 /* CyclingCadenceService.swift */,
2740E07928E5DEC500293B71 /* CyclingPowerService.swift */,
2704225A2905DC6300FD02D4 /* CyclingRadarService.swift */,
27F59AE62C1250FC00AE1B6D /* HeartRatePeripheralManager.swift */,
2740E07728E5DEC500293B71 /* HeartRateService.swift */,
);
name = LibBluetooth;
Expand Down Expand Up @@ -1482,7 +1486,7 @@
attributes = {
BuildIndependentTargetsInParallel = 1;
LastSwiftUpdateCheck = 1410;
LastUpgradeCheck = 1500;
LastUpgradeCheck = 1540;
TargetAttributes = {
278D92BF28E38F17003B077C = {
CreatedOnToolsVersion = 14.0;
Expand Down Expand Up @@ -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 */,
Expand Down Expand Up @@ -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 */,
Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -2033,18 +2040,21 @@
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;
};
278D930B28E38F19003B077C /* Release */ = {
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";
Expand Down Expand Up @@ -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;
};
Expand Down Expand Up @@ -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;
};
Expand Down Expand Up @@ -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;
};
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions Watch App/ActivityView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}
Expand Down
28 changes: 14 additions & 14 deletions iPhone App/ActivityPreferencesView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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() {
Expand All @@ -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")
}
Expand All @@ -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")
}
Expand Down
2 changes: 1 addition & 1 deletion iPhone App/ActivityView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
8 changes: 4 additions & 4 deletions iPhone App/EditIntervalSessionView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions iPhone App/EditPacePlanView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand All @@ -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
}
}
Expand All @@ -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
}
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions iPhone App/HistoryDetailsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions iPhone App/ProfileView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand All @@ -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())
Expand All @@ -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())
Expand Down
2 changes: 1 addition & 1 deletion iPhone App/SensorsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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: [])
Expand Down
Loading

0 comments on commit f7aeeb4

Please sign in to comment.