Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added option to click on 'X' to close measurements PDF #58

Merged
merged 5 commits into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Stronger.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
2FE5DCB129EE6107004B9AB4 /* AccountOnboarding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FE5DCAC29EE6107004B9AB4 /* AccountOnboarding.swift */; };
2FF53D8B2A8725DE00042B76 /* SpeziMockWebService in Frameworks */ = {isa = PBXBuildFile; productRef = 2FF53D8A2A8725DE00042B76 /* SpeziMockWebService */; };
2FF53D8D2A8729D600042B76 /* StrongerStandard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FF53D8C2A8729D600042B76 /* StrongerStandard.swift */; };
3821BC9E2B98A2A100F623B4 /* measurements.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 3821BC9D2B98A2A100F623B4 /* measurements.pdf */; };
3821BC9E2B98A2A100F623B4 /* measure.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 3821BC9D2B98A2A100F623B4 /* measure.pdf */; };
38756AA32B946C6700FDF599 /* pulldowns.mp4 in Resources */ = {isa = PBXBuildFile; fileRef = 38756A942B946C5800FDF599 /* pulldowns.mp4 */; };
38756AA42B946C6700FDF599 /* rows.mp4 in Resources */ = {isa = PBXBuildFile; fileRef = 38756A952B946C5800FDF599 /* rows.mp4 */; };
38756AA52B946C6700FDF599 /* lungesright.mp4 in Resources */ = {isa = PBXBuildFile; fileRef = 38756A962B946C5800FDF599 /* lungesright.mp4 */; };
Expand Down Expand Up @@ -202,7 +202,7 @@
2FE5DC5529EDD811004B9AB4 /* SocialSupportQuestionnaire.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = SocialSupportQuestionnaire.json; sourceTree = "<group>"; };
2FE5DCAC29EE6107004B9AB4 /* AccountOnboarding.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AccountOnboarding.swift; sourceTree = "<group>"; };
2FF53D8C2A8729D600042B76 /* StrongerStandard.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StrongerStandard.swift; sourceTree = "<group>"; };
3821BC9D2B98A2A100F623B4 /* measurements.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = measurements.pdf; sourceTree = "<group>"; };
3821BC9D2B98A2A100F623B4 /* measure.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = measure.pdf; sourceTree = "<group>"; };
38756A942B946C5800FDF599 /* pulldowns.mp4 */ = {isa = PBXFileReference; lastKnownFileType = file; path = pulldowns.mp4; sourceTree = "<group>"; };
38756A952B946C5800FDF599 /* rows.mp4 */ = {isa = PBXFileReference; lastKnownFileType = file; path = rows.mp4; sourceTree = "<group>"; };
38756A962B946C5800FDF599 /* lungesright.mp4 */ = {isa = PBXFileReference; lastKnownFileType = file; path = lungesright.mp4; sourceTree = "<group>"; };
Expand Down Expand Up @@ -380,7 +380,7 @@
2FE5DC2D29EDD792004B9AB4 /* Resources */ = {
isa = PBXGroup;
children = (
3821BC9D2B98A2A100F623B4 /* measurements.pdf */,
3821BC9D2B98A2A100F623B4 /* measure.pdf */,
38756AB12B946D0E00FDF599 /* ExerciseInfo.json */,
4036AE6A2B9543ED00F4DDBB /* exercise_list.json */,
38756AA12B946C6700FDF599 /* calfraises.mp4 */,
Expand Down Expand Up @@ -775,7 +775,7 @@
2FA0BFED2ACC977500E0EF83 /* Localizable.xcstrings in Resources */,
38756AAE2B946C6700FDF599 /* squats.mp4 in Resources */,
38756AA52B946C6700FDF599 /* lungesright.mp4 in Resources */,
3821BC9E2B98A2A100F623B4 /* measurements.pdf in Resources */,
3821BC9E2B98A2A100F623B4 /* measure.pdf in Resources */,
38756AA72B946C6700FDF599 /* pushups.mp4 in Resources */,
38756AA32B946C6700FDF599 /* pulldowns.mp4 in Resources */,
4036AE6B2B9543ED00F4DDBB /* exercise_list.json in Resources */,
Expand Down
17 changes: 13 additions & 4 deletions Stronger/MainPage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,20 @@
import WebKit

struct PDFViewer: View {
@Environment(\.presentationMode) var presentationMode
var body: some View {
if let path = Bundle.main.path(forResource: "measurements", ofType: "pdf"), let pdfDocument = PDFDocument(url: URL(fileURLWithPath: path)) {
PDFKitView(pdfDocument: pdfDocument)
} else {
Text("Unable to load the PDF file.")
NavigationView {
if let path = Bundle.main.path(forResource: "measure", ofType: "pdf"), let pdfDocument = PDFDocument(url: URL(fileURLWithPath: path)) {
PDFKitView(pdfDocument: pdfDocument)
.navigationBarItems(trailing: Button(action: {
self.presentationMode.wrappedValue.dismiss()
}) {
Image(systemName: "xmark")
.accessibilityLabel("Close")
})
} else {
Text("Unable to load the PDF file.")
}

Check warning on line 35 in Stronger/MainPage.swift

View check run for this annotation

Codecov / codecov/patch

Stronger/MainPage.swift#L24-L35

Added lines #L24 - L35 were not covered by tests
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions Stronger/Resources/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@
},
"Click an item image to edit or next to continue" : {

},
"Close" : {

},
"CLOSE" : {
"comment" : "MARK: General",
Expand Down
File renamed without changes.
Loading