Skip to content

Commit

Permalink
Added option to click on 'X' to close measurements PDF (#58)
Browse files Browse the repository at this point in the history
# *Adding_Close_Button_PDF*

## ♻️ Current situation & Problem
User had to slide down to close the PDF, adding to inconvenience and
defeating purpose of making app as easy to use as possible.


## ⚙️ Release Notes 
Added an 'X' button to close the PDF


## 📚 Documentation
*Please ensure that you properly document any additions in conformance
to [Spezi Documentation
Guide](https://github.com/StanfordSpezi/.github/blob/main/DOCUMENTATIONGUIDE.md).*
*You can use this section to describe your solution, but we encourage
contributors to document your reasoning and changes using in-line
documentation.*


## ✅ Testing
*Please ensure that the PR meets the testing requirements set by CodeCov
and that new functionality is appropriately tested.*
*This section describes important information about the tests and why
some elements might not be testable.*


## 📝 Code of Conduct & Contributing Guidelines 

By submitting creating this pull request, you agree to follow our [Code
of
Conduct](https://github.com/CS342/.github/blob/main/CODE_OF_CONDUCT.md)
and [Contributing
Guidelines](https://github.com/CS342/.github/blob/main/CONTRIBUTING.md):
- [x] I agree to follow the [Code of
Conduct](https://github.com/CS342/.github/blob/main/CODE_OF_CONDUCT.md)
and [Contributing
Guidelines](https://github.com/CS342/.github/blob/main/CONTRIBUTING.md).
  • Loading branch information
yanavlall authored Mar 8, 2024
1 parent b5e9ec3 commit 63259a5
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 8 deletions.
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 SwiftUI
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.")
}
}
}
}
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.
File renamed without changes.

0 comments on commit 63259a5

Please sign in to comment.