Skip to content

Commit bc63e2d

Browse files
committed
Update schedule event
1 parent 1ca887f commit bc63e2d

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

ParseCareKit.xcodeproj/project.pbxproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1189,7 +1189,7 @@
11891189
repositoryURL = "https://github.com/cbaker6/CareKit.git";
11901190
requirement = {
11911191
kind = upToNextMajorVersion;
1192-
minimumVersion = "3.0.0-alpha.6";
1192+
minimumVersion = "3.0.0-alpha.17";
11931193
};
11941194
};
11951195
/* End XCRemoteSwiftPackageReference section */

Sources/ParseCareKit/Models/PCKOutcome.swift

+5-3
Original file line numberDiff line numberDiff line change
@@ -392,15 +392,17 @@ public struct PCKOutcome: PCKVersionable, PCKSynchronizable {
392392

393393
mutableOutcome.task = foundTask
394394

395-
guard let currentTask = mutableOutcome.task else {
395+
guard let currentTask = mutableOutcome.task,
396+
let schedule = currentTask.schedule,
397+
let event = schedule.event(forOccurrenceIndex: taskOccurrenceIndex) else {
396398
mutableOutcome.startDate = nil
397399
mutableOutcome.endDate = nil
398400
completion(.success(mutableOutcome))
399401
return
400402
}
401403

402-
mutableOutcome.startDate = currentTask.schedule?.event(forOccurrenceIndex: taskOccurrenceIndex)?.start
403-
mutableOutcome.endDate = currentTask.schedule?.event(forOccurrenceIndex: taskOccurrenceIndex)?.end
404+
mutableOutcome.startDate = event.start
405+
mutableOutcome.endDate = event.end
404406
completion(.success(mutableOutcome))
405407

406408
case .failure:

0 commit comments

Comments
 (0)