Skip to content

Commit b58e233

Browse files
Committing version 1.0.3-beta
1 parent b08c424 commit b58e233

File tree

2,318 files changed

+89220
-1236
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,318 files changed

+89220
-1236
lines changed

.github/workflows/Deploying.yml

+4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ jobs:
1414
uses: maxim-lobanov/setup-cocoapods@v1
1515
with:
1616
version: 1.11.3
17+
- name: Github Credentials Store Setup
18+
run: |
19+
git config --global credential.helper store
20+
echo "https://${{ secrets.REPO_USERNAME }}:${{ secrets.ACCESS_TOKEN }}@github.com" > ~/.git-credentials
1721
- name: Install pods
1822
run: pod install
1923
- name: Setup keychain

.github/workflows/Testing.yml

+4
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ jobs:
1717
uses: maxim-lobanov/setup-cocoapods@v1
1818
with:
1919
version: 1.11.3
20+
- name: Github Credentials Store Setup
21+
run: |
22+
git config --global credential.helper store
23+
echo "https://${{ secrets.REPO_USERNAME }}:${{ secrets.ACCESS_TOKEN }}@github.com" > ~/.git-credentials
2024
- name: Install pods
2125
run: pod install
2226
- name: Testing iOS app

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
xcuserdata/
77

88
## DS_Store
9-
.DS_Store
9+
.DS_Store*
1010

1111
## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
1212
*.xcscmblueprint

Docs/12-Profile.png

325 KB
Loading

Docs/30-Profile-Before-Change.png

1.5 MB
Loading

Docs/31-Profile-With-Change.png

1.54 MB
Loading

Docs/32-Profile-After-Sync.png

1.56 MB
Loading

Docs/36-FormStep.png

-74.6 KB
Binary file not shown.

Docs/37-ValuePickerAnswerFormat.png

-60.1 KB
Binary file not shown.

Docs/38-TextChoiceAnswerFormat_2.png

-69.5 KB
Binary file not shown.

Docs/84-urlScheme.png

80.2 KB
Loading

Docs/84-voice-over.png

287 KB
Loading

Docs/85-voice-control.png

307 KB
Loading

Docs/86-bold-text.PNG

274 KB
Loading

Docs/87-custom-font.png

537 KB
Loading

Docs/88-apple-watch-demo.png

280 KB
Loading

Docs/88-custom-font-demo.jpeg

314 KB
Loading

Docs/89-custom-image-name.png

55.1 KB
Loading

Docs/90-custom-consent-image.png

665 KB
Loading

Docs/91-apple-watch-demo.png

677 KB
Loading

Docs/92-image-assets.png

114 KB
Loading

Docs/biometric_authentication.png

176 KB
Loading

Docs/consent_02.png

393 KB
Loading

Docs/gmail_login_info.png

389 KB
Loading

Docs/password_less_01.png

594 KB
Loading

Docs/password_less_02.png

233 KB
Loading

Docs/register-api-key.png

203 KB
Loading

Docs/show-api-key-details.png

175 KB
Loading

Docs/show-api-key.png

227 KB
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"colors" : [
3+
{
4+
"idiom" : "universal"
5+
}
6+
],
7+
"info" : {
8+
"author" : "xcode",
9+
"version" : 1
10+
}
11+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "universal",
5+
"platform" : "watchos",
6+
"size" : "1024x1024"
7+
}
8+
],
9+
"info" : {
10+
"author" : "xcode",
11+
"version" : 1
12+
}
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
//
2+
// CareKitListView.swift
3+
// OTFMagicBox Watch Watch App
4+
//
5+
// Created by Tomas Martins on 13/09/23.
6+
//
7+
8+
import SwiftUI
9+
import Contacts
10+
import OTFCareKit
11+
import OTFCareKitUI
12+
import OTFCareKitStore
13+
14+
struct CareKitListView: View {
15+
@ObservedObject var storeManager: OCKStoreManager = .shared
16+
@State var tasks: [OCKTask] = []
17+
18+
var body: some View {
19+
List {
20+
if tasks.isEmpty {
21+
emptyState
22+
} else {
23+
ForEach(tasks, id: \.id) { task in
24+
SimpleTaskView(isComplete: false) {
25+
Text(task.title ?? "No title for task")
26+
}
27+
}
28+
}
29+
}
30+
.task {
31+
await fetchTasksAsync()
32+
}
33+
.refreshable {
34+
await fetchTasksAsync()
35+
}
36+
}
37+
38+
func fetchTasksAsync() async {
39+
await withCheckedContinuation { continuation in
40+
Task {
41+
storeManager.coreDataStore.populateSampleData()
42+
storeManager.coreDataStore.fetchTasks { result in
43+
switch result {
44+
case .success(let success):
45+
self.tasks = success
46+
continuation.resume()
47+
case .failure(let error):
48+
dump(error)
49+
self.tasks = []
50+
continuation.resume()
51+
}
52+
}
53+
}
54+
}
55+
}
56+
57+
var emptyState: some View {
58+
SimpleTaskView(title: Text(Constants.CustomiseStrings.noTasks),
59+
detail: Text(Constants.CustomiseStrings.noTasksForThisDate),
60+
isComplete: false)
61+
}
62+
}
63+
64+
struct CareKitListView_Previews: PreviewProvider {
65+
static var previews: some View {
66+
CareKitListView()
67+
}
68+
}
69+
70+
internal extension OCKStore {
71+
72+
enum Tasks: String, CaseIterable {
73+
case doxylamine
74+
case nausea
75+
case kegels
76+
}
77+
78+
enum Contacts: String, CaseIterable {
79+
case jane
80+
case matthew
81+
}
82+
83+
// Adds tasks and contacts into the store
84+
func populateSampleData() {
85+
86+
let thisMorning = Calendar.current.startOfDay(for: Date())
87+
let aFewDaysAgo = Calendar.current.date(byAdding: .day, value: -4, to: thisMorning)!
88+
let beforeBreakfast = Calendar.current.date(byAdding: .hour, value: 8, to: aFewDaysAgo)!
89+
let afterLunch = Calendar.current.date(byAdding: .hour, value: 14, to: aFewDaysAgo)!
90+
91+
let schedule = OCKSchedule(composing: [
92+
OCKScheduleElement(start: beforeBreakfast, end: nil,
93+
interval: DateComponents(day: 1)),
94+
95+
OCKScheduleElement(start: afterLunch, end: nil,
96+
interval: DateComponents(day: 2))
97+
])
98+
99+
var doxylamine = OCKTask(id: Tasks.doxylamine.rawValue, title: "Take Doxylamine",
100+
carePlanUUID: nil, schedule: schedule)
101+
doxylamine.instructions = "Take 25mg of doxylamine when you experience nausea."
102+
doxylamine.asset = "pills"
103+
let nauseaSchedule = OCKSchedule(composing: [
104+
OCKScheduleElement(start: beforeBreakfast, end: nil, interval: DateComponents(day: 1),
105+
text: "Anytime throughout the day", targetValues: [], duration: .allDay)
106+
])
107+
108+
var nausea = OCKTask(id: Tasks.nausea.rawValue, title: "Track your nausea",
109+
carePlanUUID: nil, schedule: nauseaSchedule)
110+
nausea.impactsAdherence = false
111+
nausea.instructions = "Tap the button below anytime you experience nausea."
112+
113+
let kegelElement = OCKScheduleElement(start: beforeBreakfast, end: nil, interval: DateComponents(day: 2))
114+
let kegelSchedule = OCKSchedule(composing: [kegelElement])
115+
var kegels = OCKTask(id: Tasks.kegels.rawValue, title: "Kegel Exercises", carePlanUUID: nil, schedule: kegelSchedule)
116+
kegels.impactsAdherence = true
117+
kegels.instructions = "Perform kegel exercies"
118+
119+
addTasks([nausea, doxylamine, kegels], callbackQueue: .main, completion: nil)
120+
121+
var contact1 = OCKContact(id: Contacts.jane.rawValue, givenName: "Jane",
122+
familyName: "Daniels", carePlanUUID: nil)
123+
contact1.asset = "JaneDaniels"
124+
contact1.title = "Family Practice Doctor"
125+
contact1.role = "Dr. Daniels is a family practice doctor with 8 years of experience."
126+
contact1.emailAddresses = [OCKLabeledValue(label: CNLabelEmailiCloud, value: "[email protected]")]
127+
contact1.phoneNumbers = [OCKLabeledValue(label: CNLabelWork, value: "(324) 555-7415")]
128+
contact1.messagingNumbers = [OCKLabeledValue(label: CNLabelWork, value: "(324) 555-7415")]
129+
130+
contact1.address = {
131+
let address = OCKPostalAddress()
132+
address.street = "2598 Reposa Way"
133+
address.city = "San Francisco"
134+
address.state = "CA"
135+
address.postalCode = "94127"
136+
return address
137+
}()
138+
139+
var contact2 = OCKContact(id: Contacts.matthew.rawValue, givenName: "Matthew",
140+
familyName: "Reiff", carePlanUUID: nil)
141+
contact2.asset = "MatthewReiff"
142+
contact2.title = "OBGYN"
143+
contact2.role = "Dr. Reiff is an OBGYN with 13 years of experience."
144+
contact2.phoneNumbers = [OCKLabeledValue(label: CNLabelWork, value: "(324) 555-7415")]
145+
contact2.messagingNumbers = [OCKLabeledValue(label: CNLabelWork, value: "(324) 555-7415")]
146+
contact2.address = {
147+
let address = OCKPostalAddress()
148+
address.street = "396 El Verano Way"
149+
address.city = "San Francisco"
150+
address.state = "CA"
151+
address.postalCode = "94127"
152+
return address
153+
}()
154+
155+
addContacts([contact1, contact2])
156+
}
157+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//
2+
// ContentView.swift
3+
// OTFMagicBox Watch Watch App
4+
//
5+
// Created by Tomas Martins on 14/08/23.
6+
//
7+
8+
import SwiftUI
9+
10+
struct ContentView: View {
11+
var body: some View {
12+
CareKitListView()
13+
}
14+
}
15+
16+
struct ContentView_Previews: PreviewProvider {
17+
static var previews: some View {
18+
ContentView()
19+
}
20+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>com.apple.developer.healthkit</key>
6+
<true/>
7+
<key>com.apple.developer.healthkit.access</key>
8+
<array/>
9+
<key>com.apple.developer.healthkit.background-delivery</key>
10+
<true/>
11+
</dict>
12+
</plist>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//
2+
// OTFMagicBox_WatchApp.swift
3+
// OTFMagicBox Watch Watch App
4+
//
5+
// Created by Tomas Martins on 14/08/23.
6+
//
7+
8+
import SwiftUI
9+
10+
@main
11+
struct OTFMagicBox_Watch_Watch_AppApp: App {
12+
var body: some Scene {
13+
WindowGroup {
14+
ContentView()
15+
}
16+
}
17+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"info" : {
3+
"author" : "xcode",
4+
"version" : 1
5+
}
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
//
2+
// OTFMagicBox_Watch_Watch_AppTests.swift
3+
// OTFMagicBox Watch Watch AppTests
4+
//
5+
// Created by Tomas Martins on 14/08/23.
6+
//
7+
8+
import XCTest
9+
@testable import OTFMagicBox_Watch_Watch_App
10+
11+
final class OTFMagicBox_Watch_Watch_AppTests: XCTestCase {
12+
13+
override func setUpWithError() throws {
14+
// Put setup code here. This method is called before the invocation of each test method in the class.
15+
}
16+
17+
override func tearDownWithError() throws {
18+
// Put teardown code here. This method is called after the invocation of each test method in the class.
19+
}
20+
21+
func testExample() throws {
22+
// This is an example of a functional test case.
23+
// Use XCTAssert and related functions to verify your tests produce the correct results.
24+
// Any test you write for XCTest can be annotated as throws and async.
25+
// Mark your test throws to produce an unexpected failure when your test encounters an uncaught error.
26+
// Tests marked async will run the test method on an arbitrary thread managed by the Swift runtime.
27+
}
28+
29+
func testPerformanceExample() throws {
30+
// This is an example of a performance test case.
31+
self.measure {
32+
// Put the code you want to measure the time of here.
33+
}
34+
}
35+
36+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
//
2+
// OTFMagicBox_Watch_Watch_AppUITests.swift
3+
// OTFMagicBox Watch Watch AppUITests
4+
//
5+
// Created by Tomas Martins on 14/08/23.
6+
//
7+
8+
import XCTest
9+
10+
final class OTFMagicBox_Watch_Watch_AppUITests: XCTestCase {
11+
12+
override func setUpWithError() throws {
13+
// Put setup code here. This method is called before the invocation of each test method in the class.
14+
15+
// In UI tests it is usually best to stop immediately when a failure occurs.
16+
continueAfterFailure = false
17+
18+
// In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this.
19+
}
20+
21+
override func tearDownWithError() throws {
22+
// Put teardown code here. This method is called after the invocation of each test method in the class.
23+
}
24+
25+
func testExample() throws {
26+
// UI tests must launch the application that they test.
27+
let app = XCUIApplication()
28+
app.launch()
29+
30+
// Use XCTAssert and related functions to verify your tests produce the correct results.
31+
}
32+
33+
func testLaunchPerformance() throws {
34+
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 7.0, *) {
35+
// This measures how long it takes to launch your application.
36+
measure(metrics: [XCTApplicationLaunchMetric()]) {
37+
XCUIApplication().launch()
38+
}
39+
}
40+
}
41+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
//
2+
// OTFMagicBox_Watch_Watch_AppUITestsLaunchTests.swift
3+
// OTFMagicBox Watch Watch AppUITests
4+
//
5+
// Created by Tomas Martins on 14/08/23.
6+
//
7+
8+
import XCTest
9+
10+
final class OTFMagicBox_Watch_Watch_AppUITestsLaunchTests: XCTestCase {
11+
12+
override class var runsForEachTargetApplicationUIConfiguration: Bool {
13+
true
14+
}
15+
16+
override func setUpWithError() throws {
17+
continueAfterFailure = false
18+
}
19+
20+
func testLaunch() throws {
21+
let app = XCUIApplication()
22+
app.launch()
23+
24+
// Insert steps here to perform after app launch but before taking a screenshot,
25+
// such as logging into a test account or navigating somewhere in the app
26+
27+
let attachment = XCTAttachment(screenshot: app.screenshot())
28+
attachment.name = "Launch Screen"
29+
attachment.lifetime = .keepAlways
30+
add(attachment)
31+
}
32+
}

0 commit comments

Comments
 (0)