Skip to content

Commit 4d33e71

Browse files
committed
- Fixes #13 with indoor/outdoor info in the workout name
1 parent c67091a commit 4d33e71

File tree

16 files changed

+629
-25
lines changed

16 files changed

+629
-25
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pod install
1818

1919
in a terminal in the project directory to download linked frameworks and use `Workout.xcworkspace` to open the project.
2020

21-
The frameworks `MBLibrary` and `MBHealth` referenced by this project are available [here](https://github.com/piscoTech/MBLibrary), version currently in use is [1.7](https://github.com/piscoTech/MBLibrary/releases/tag/v1.7(18)).
21+
The frameworks `MBLibrary` and `MBHealth` referenced by this project are available [here](https://github.com/piscoTech/MBLibrary), version currently in use is [1.7.1](https://github.com/piscoTech/MBLibrary/releases/tag/v1.7.1(19)).
2222

2323
## Customization
2424
General behaviour of the app can be configured at compile time as specified in the [wiki](https://github.com/piscoTech/Workout/wiki#compile-time-setup).

Workout Core/Model/Workout/Workout.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ public class Workout {
5454
/// Max acceptable pace, if any, in time per unit length.
5555
private(set) var maxPace: HKQuantity?
5656

57+
public var name: String {
58+
return raw.workoutActivityName
59+
}
5760
public var type: HKWorkoutActivityType {
5861
return raw.workoutActivityType
5962
}
@@ -369,7 +372,7 @@ public class Workout {
369372

370373
private func generalData(for systemOfUnits: SystemOfUnits) -> [String] {
371374
[
372-
type.name.toCSV(),
375+
name.toCSV(),
373376
startDate.getUNIXDateTime().toCSV(),
374377
endDate.getUNIXDateTime().toCSV(),
375378
duration.getRawDuration().toCSV(),
@@ -418,7 +421,6 @@ public class Workout {
418421
data += "\("Total Energy \(WorkoutUnit.calories.unit(for: systemOfUnits).description)".toCSV())\(sep)" + genData[10] + "\n"
419422
data += "\("Elevation Ascended \(WorkoutUnit.elevation.unit(for: systemOfUnits).description)".toCSV())\(sep)" + genData[11] + "\n"
420423
data += "\("Elevation Descended \(WorkoutUnit.elevation.unit(for: systemOfUnits).description)".toCSV())\(sep)" + genData[12] + "\n"
421-
422424

423425
do {
424426
try data.write(to: general, atomically: true, encoding: .utf8)

Workout.xcodeproj/project.pbxproj

Lines changed: 156 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,13 @@
2929
7A650B6922C1354500059687 /* AboutVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A650B4E22C1354200059687 /* AboutVC.swift */; };
3030
7A650B6E22C1354500059687 /* LoadMoreCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A650B5322C1354300059687 /* LoadMoreCell.swift */; };
3131
7A714AA722D0D90B00AB7DD0 /* AdsManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A714AA622D0D90B00AB7DD0 /* AdsManager.swift */; };
32+
7A7170FE2365B355005A3314 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A7170FD2365B355005A3314 /* AppDelegate.swift */; };
33+
7A7171002365B355005A3314 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A7170FF2365B355005A3314 /* SceneDelegate.swift */; };
34+
7A7171022365B355005A3314 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A7171012365B355005A3314 /* ContentView.swift */; };
35+
7A7171042365B35C005A3314 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 7A7171032365B35C005A3314 /* Assets.xcassets */; };
36+
7A7171072365B35C005A3314 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 7A7171062365B35C005A3314 /* Preview Assets.xcassets */; };
37+
7A71710A2365B35C005A3314 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 7A7171082365B35C005A3314 /* LaunchScreen.storyboard */; };
38+
7A7171162365B36E005A3314 /* HealthKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7A650B1622C1307200059687 /* HealthKit.framework */; };
3239
7A79B1E222DB205800106F14 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 7AA121EC22C1373B0063E0F3 /* Localizable.strings */; };
3340
7A79B1E322DB205800106F14 /* Localizable.stringsdict in Resources */ = {isa = PBXBuildFile; fileRef = 7AA121EE22C1373C0063E0F3 /* Localizable.stringsdict */; };
3441
7A9BF6CC22CA233900EC1D95 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A9BF6CB22CA233900EC1D95 /* Extensions.swift */; };
@@ -178,6 +185,15 @@
178185
7A650B5722C1354400059687 /* WorkoutUnit.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WorkoutUnit.swift; sourceTree = "<group>"; };
179186
7A650B5822C1354500059687 /* AdditionalDataProcessor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AdditionalDataProcessor.swift; sourceTree = "<group>"; };
180187
7A714AA622D0D90B00AB7DD0 /* AdsManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdsManager.swift; sourceTree = "<group>"; };
188+
7A7170FB2365B355005A3314 /* WorkoutHelper.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = WorkoutHelper.app; sourceTree = BUILT_PRODUCTS_DIR; };
189+
7A7170FD2365B355005A3314 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
190+
7A7170FF2365B355005A3314 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
191+
7A7171012365B355005A3314 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
192+
7A7171032365B35C005A3314 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
193+
7A7171062365B35C005A3314 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
194+
7A7171092365B35C005A3314 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
195+
7A71710B2365B35C005A3314 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
196+
7A7171152365B36E005A3314 /* WorkoutHelper.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = WorkoutHelper.entitlements; sourceTree = "<group>"; };
181197
7A9BF6CB22CA233900EC1D95 /* Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = "<group>"; };
182198
7A9BF6D322CA317600EC1D95 /* FilterCells.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FilterCells.swift; sourceTree = "<group>"; };
183199
7AA121E722C1370D0063E0F3 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
@@ -212,6 +228,14 @@
212228
);
213229
runOnlyForDeploymentPostprocessing = 0;
214230
};
231+
7A7170F82365B355005A3314 /* Frameworks */ = {
232+
isa = PBXFrameworksBuildPhase;
233+
buildActionMask = 2147483647;
234+
files = (
235+
7A7171162365B36E005A3314 /* HealthKit.framework in Frameworks */,
236+
);
237+
runOnlyForDeploymentPostprocessing = 0;
238+
};
215239
7AB7CD7E22C4D774001A0171 /* Frameworks */ = {
216240
isa = PBXFrameworksBuildPhase;
217241
buildActionMask = 2147483647;
@@ -333,6 +357,7 @@
333357
7A650B1B22C132D900059687 /* MBLibrary.xcodeproj */,
334358
7AB7CD8222C4D774001A0171 /* Workout Core */,
335359
7A650AFF22C1300100059687 /* Workout */,
360+
7A7170FC2365B355005A3314 /* WorkoutHelper */,
336361
7A650AFE22C1300100059687 /* Products */,
337362
7A650B1522C1307200059687 /* Frameworks */,
338363
A120C71C422EB50006948EBF /* Pods */,
@@ -344,6 +369,7 @@
344369
children = (
345370
7A650AFD22C1300100059687 /* Workout.app */,
346371
7AB7CD8122C4D774001A0171 /* WorkoutCore.framework */,
372+
7A7170FB2365B355005A3314 /* WorkoutHelper.app */,
347373
);
348374
name = Products;
349375
sourceTree = "<group>";
@@ -398,6 +424,29 @@
398424
name = Products;
399425
sourceTree = "<group>";
400426
};
427+
7A7170FC2365B355005A3314 /* WorkoutHelper */ = {
428+
isa = PBXGroup;
429+
children = (
430+
7A7171152365B36E005A3314 /* WorkoutHelper.entitlements */,
431+
7A7170FD2365B355005A3314 /* AppDelegate.swift */,
432+
7A7170FF2365B355005A3314 /* SceneDelegate.swift */,
433+
7A7171012365B355005A3314 /* ContentView.swift */,
434+
7A7171032365B35C005A3314 /* Assets.xcassets */,
435+
7A7171082365B35C005A3314 /* LaunchScreen.storyboard */,
436+
7A71710B2365B35C005A3314 /* Info.plist */,
437+
7A7171052365B35C005A3314 /* Preview Content */,
438+
);
439+
path = WorkoutHelper;
440+
sourceTree = "<group>";
441+
};
442+
7A7171052365B35C005A3314 /* Preview Content */ = {
443+
isa = PBXGroup;
444+
children = (
445+
7A7171062365B35C005A3314 /* Preview Assets.xcassets */,
446+
);
447+
path = "Preview Content";
448+
sourceTree = "<group>";
449+
};
401450
7AB7CD8222C4D774001A0171 /* Workout Core */ = {
402451
isa = PBXGroup;
403452
children = (
@@ -490,6 +539,23 @@
490539
productReference = 7A650AFD22C1300100059687 /* Workout.app */;
491540
productType = "com.apple.product-type.application";
492541
};
542+
7A7170FA2365B355005A3314 /* WorkoutHelper */ = {
543+
isa = PBXNativeTarget;
544+
buildConfigurationList = 7A7171142365B35C005A3314 /* Build configuration list for PBXNativeTarget "WorkoutHelper" */;
545+
buildPhases = (
546+
7A7170F72365B355005A3314 /* Sources */,
547+
7A7170F82365B355005A3314 /* Frameworks */,
548+
7A7170F92365B355005A3314 /* Resources */,
549+
);
550+
buildRules = (
551+
);
552+
dependencies = (
553+
);
554+
name = WorkoutHelper;
555+
productName = WorkoutHelper;
556+
productReference = 7A7170FB2365B355005A3314 /* WorkoutHelper.app */;
557+
productType = "com.apple.product-type.application";
558+
};
493559
7AB7CD8022C4D774001A0171 /* Workout Core */ = {
494560
isa = PBXNativeTarget;
495561
buildConfigurationList = 7AB7CD9222C4D774001A0171 /* Build configuration list for PBXNativeTarget "Workout Core" */;
@@ -515,13 +581,16 @@
515581
7A650AF522C1300000059687 /* Project object */ = {
516582
isa = PBXProject;
517583
attributes = {
518-
LastSwiftUpdateCheck = 1100;
584+
LastSwiftUpdateCheck = 1110;
519585
LastUpgradeCheck = 1100;
520586
ORGANIZATIONNAME = "Marco Boschi";
521587
TargetAttributes = {
522588
7A650AFC22C1300100059687 = {
523589
CreatedOnToolsVersion = 11.0;
524590
};
591+
7A7170FA2365B355005A3314 = {
592+
CreatedOnToolsVersion = 11.1;
593+
};
525594
7AB7CD8022C4D774001A0171 = {
526595
CreatedOnToolsVersion = 11.0;
527596
};
@@ -548,6 +617,7 @@
548617
targets = (
549618
7A650AFC22C1300100059687 /* Workout */,
550619
7AB7CD8022C4D774001A0171 /* Workout Core */,
620+
7A7170FA2365B355005A3314 /* WorkoutHelper */,
551621
);
552622
};
553623
/* End PBXProject section */
@@ -610,6 +680,16 @@
610680
);
611681
runOnlyForDeploymentPostprocessing = 0;
612682
};
683+
7A7170F92365B355005A3314 /* Resources */ = {
684+
isa = PBXResourcesBuildPhase;
685+
buildActionMask = 2147483647;
686+
files = (
687+
7A71710A2365B35C005A3314 /* LaunchScreen.storyboard in Resources */,
688+
7A7171072365B35C005A3314 /* Preview Assets.xcassets in Resources */,
689+
7A7171042365B35C005A3314 /* Assets.xcassets in Resources */,
690+
);
691+
runOnlyForDeploymentPostprocessing = 0;
692+
};
613693
7AB7CD7F22C4D774001A0171 /* Resources */ = {
614694
isa = PBXResourcesBuildPhase;
615695
buildActionMask = 2147483647;
@@ -707,6 +787,16 @@
707787
);
708788
runOnlyForDeploymentPostprocessing = 0;
709789
};
790+
7A7170F72365B355005A3314 /* Sources */ = {
791+
isa = PBXSourcesBuildPhase;
792+
buildActionMask = 2147483647;
793+
files = (
794+
7A7170FE2365B355005A3314 /* AppDelegate.swift in Sources */,
795+
7A7171002365B355005A3314 /* SceneDelegate.swift in Sources */,
796+
7A7171022365B355005A3314 /* ContentView.swift in Sources */,
797+
);
798+
runOnlyForDeploymentPostprocessing = 0;
799+
};
710800
7AB7CD7D22C4D774001A0171 /* Sources */ = {
711801
isa = PBXSourcesBuildPhase;
712802
buildActionMask = 2147483647;
@@ -750,6 +840,14 @@
750840
/* End PBXTargetDependency section */
751841

752842
/* Begin PBXVariantGroup section */
843+
7A7171082365B35C005A3314 /* LaunchScreen.storyboard */ = {
844+
isa = PBXVariantGroup;
845+
children = (
846+
7A7171092365B35C005A3314 /* Base */,
847+
);
848+
name = LaunchScreen.storyboard;
849+
sourceTree = "<group>";
850+
};
753851
7AA121E622C1370D0063E0F3 /* LaunchScreen.storyboard */ = {
754852
isa = PBXVariantGroup;
755853
children = (
@@ -819,7 +917,7 @@
819917
CLANG_WARN_UNREACHABLE_CODE = YES;
820918
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
821919
COPY_PHASE_STRIP = NO;
822-
CURRENT_PROJECT_VERSION = 22;
920+
CURRENT_PROJECT_VERSION = 23;
823921
DEBUG_INFORMATION_FORMAT = dwarf;
824922
ENABLE_STRICT_OBJC_MSGSEND = YES;
825923
ENABLE_TESTABILITY = YES;
@@ -838,7 +936,7 @@
838936
GCC_WARN_UNUSED_FUNCTION = YES;
839937
GCC_WARN_UNUSED_VARIABLE = YES;
840938
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
841-
MARKETING_VERSION = 1.7;
939+
MARKETING_VERSION = 1.7.1;
842940
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
843941
MTL_FAST_MATH = YES;
844942
ONLY_ACTIVE_ARCH = YES;
@@ -882,7 +980,7 @@
882980
CLANG_WARN_UNREACHABLE_CODE = YES;
883981
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
884982
COPY_PHASE_STRIP = NO;
885-
CURRENT_PROJECT_VERSION = 22;
983+
CURRENT_PROJECT_VERSION = 23;
886984
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
887985
ENABLE_NS_ASSERTIONS = NO;
888986
ENABLE_STRICT_OBJC_MSGSEND = YES;
@@ -895,7 +993,7 @@
895993
GCC_WARN_UNUSED_FUNCTION = YES;
896994
GCC_WARN_UNUSED_VARIABLE = YES;
897995
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
898-
MARKETING_VERSION = 1.7;
996+
MARKETING_VERSION = 1.7.1;
899997
MTL_ENABLE_DEBUG_INFO = NO;
900998
MTL_FAST_MATH = YES;
901999
SDKROOT = iphoneos;
@@ -947,6 +1045,50 @@
9471045
};
9481046
name = Release;
9491047
};
1048+
7A71710C2365B35C005A3314 /* Debug */ = {
1049+
isa = XCBuildConfiguration;
1050+
buildSettings = {
1051+
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
1052+
CODE_SIGN_ENTITLEMENTS = WorkoutHelper/WorkoutHelper.entitlements;
1053+
CODE_SIGN_STYLE = Automatic;
1054+
DEVELOPMENT_ASSET_PATHS = "\"WorkoutHelper/Preview Content\"";
1055+
DEVELOPMENT_TEAM = C8D57YLUAC;
1056+
ENABLE_PREVIEWS = YES;
1057+
INFOPLIST_FILE = WorkoutHelper/Info.plist;
1058+
IPHONEOS_DEPLOYMENT_TARGET = 13.1;
1059+
LD_RUNPATH_SEARCH_PATHS = (
1060+
"$(inherited)",
1061+
"@executable_path/Frameworks",
1062+
);
1063+
PRODUCT_BUNDLE_IDENTIFIER = "Marco-Boschi.ios.WorkoutHelper";
1064+
PRODUCT_NAME = "$(TARGET_NAME)";
1065+
SWIFT_VERSION = 5.0;
1066+
TARGETED_DEVICE_FAMILY = "1,2";
1067+
};
1068+
name = Debug;
1069+
};
1070+
7A71710D2365B35C005A3314 /* Release */ = {
1071+
isa = XCBuildConfiguration;
1072+
buildSettings = {
1073+
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
1074+
CODE_SIGN_ENTITLEMENTS = WorkoutHelper/WorkoutHelper.entitlements;
1075+
CODE_SIGN_STYLE = Automatic;
1076+
DEVELOPMENT_ASSET_PATHS = "\"WorkoutHelper/Preview Content\"";
1077+
DEVELOPMENT_TEAM = C8D57YLUAC;
1078+
ENABLE_PREVIEWS = YES;
1079+
INFOPLIST_FILE = WorkoutHelper/Info.plist;
1080+
IPHONEOS_DEPLOYMENT_TARGET = 13.1;
1081+
LD_RUNPATH_SEARCH_PATHS = (
1082+
"$(inherited)",
1083+
"@executable_path/Frameworks",
1084+
);
1085+
PRODUCT_BUNDLE_IDENTIFIER = "Marco-Boschi.ios.WorkoutHelper";
1086+
PRODUCT_NAME = "$(TARGET_NAME)";
1087+
SWIFT_VERSION = 5.0;
1088+
TARGETED_DEVICE_FAMILY = "1,2";
1089+
};
1090+
name = Release;
1091+
};
9501092
7AB7CD8A22C4D774001A0171 /* Debug */ = {
9511093
isa = XCBuildConfiguration;
9521094
baseConfigurationReference = A91EF3720C9C955433E15722 /* Pods-Workout Core.debug.xcconfig */;
@@ -1024,6 +1166,15 @@
10241166
defaultConfigurationIsVisible = 0;
10251167
defaultConfigurationName = Release;
10261168
};
1169+
7A7171142365B35C005A3314 /* Build configuration list for PBXNativeTarget "WorkoutHelper" */ = {
1170+
isa = XCConfigurationList;
1171+
buildConfigurations = (
1172+
7A71710C2365B35C005A3314 /* Debug */,
1173+
7A71710D2365B35C005A3314 /* Release */,
1174+
);
1175+
defaultConfigurationIsVisible = 0;
1176+
defaultConfigurationName = Release;
1177+
};
10271178
7AB7CD9222C4D774001A0171 /* Build configuration list for PBXNativeTarget "Workout Core" */ = {
10281179
isa = XCConfigurationList;
10291180
buildConfigurations = (

0 commit comments

Comments
 (0)