diff --git a/README.md b/README.md index 408e4af..b91209b 100644 --- a/README.md +++ b/README.md @@ -731,4 +731,5 @@ El test que se realizó es acerca del estado de animo y ansiedad, el cuál luce ![](imagenes/testAn.png) +Para la parte de actividades, se requiere crear de nuevo un Swift File, con el nombre de ActiveTaskManager diff --git a/RK-Journals/RK-Journals.xcodeproj/project.xcworkspace/xcuserdata/juandavidlopezregalado.xcuserdatad/UserInterfaceState.xcuserstate b/RK-Journals/RK-Journals.xcodeproj/project.xcworkspace/xcuserdata/juandavidlopezregalado.xcuserdatad/UserInterfaceState.xcuserstate index 1d72159..acc23b2 100644 Binary files a/RK-Journals/RK-Journals.xcodeproj/project.xcworkspace/xcuserdata/juandavidlopezregalado.xcuserdatad/UserInterfaceState.xcuserstate and b/RK-Journals/RK-Journals.xcodeproj/project.xcworkspace/xcuserdata/juandavidlopezregalado.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/RK-Journals/RK-Journals/ActiveTaskManager.swift b/RK-Journals/RK-Journals/ActiveTaskManager.swift new file mode 100644 index 0000000..e05d457 --- /dev/null +++ b/RK-Journals/RK-Journals/ActiveTaskManager.swift @@ -0,0 +1,28 @@ +// +// ActiveTaskManager.swift +// RK-Journals +// +// Created by Juan David López Regalado on 21/11/24. +// + +import Foundation +import ResearchKit +import ResearchKitUI +import ResearchKitActiveTask +import ResearchKitActiveTask_Private + + +class ActiveTaskManager { + static let shared = ActiveTaskManager() + + func createActiveTasks() -> ORKOrderedTask { + + let towerOfHanoiStep = ORKTowerOfHanoiStep( + identifier: "towerOfHanoiStep" + ) + + + + return ORKOrderedTask(identifier: "activeTasks", steps:[towerOfHanoiStep ]) + } +} diff --git a/RK-Journals/RK-Journals/Base.lproj/Main.storyboard b/RK-Journals/RK-Journals/Base.lproj/Main.storyboard index d87c107..bd36393 100644 --- a/RK-Journals/RK-Journals/Base.lproj/Main.storyboard +++ b/RK-Journals/RK-Journals/Base.lproj/Main.storyboard @@ -77,6 +77,9 @@ + + + diff --git a/RK-Journals/RK-Journals/TasksViewController.swift b/RK-Journals/RK-Journals/TasksViewController.swift index a0f77e3..8bf71db 100644 --- a/RK-Journals/RK-Journals/TasksViewController.swift +++ b/RK-Journals/RK-Journals/TasksViewController.swift @@ -44,6 +44,13 @@ class TasksViewController: UIViewController, ORKTaskViewControllerDelegate { present(taskViewController, animated: true, completion: nil) } + @IBAction func activitiesButtonTapped(_ sender: UIButton) { + let taskViewController = ORKTaskViewController(task: ActiveTaskManager.shared.createActiveTasks(), taskRun: nil) + taskViewController.delegate = self + taskViewController.modalPresentationStyle = .fullScreen + present(taskViewController, animated: true, completion: nil) + } + func consentPDFViewerTask() -> ORKOrderedTask{ var docURL = (FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)).last docURL = docURL?.appendingPathComponent("consent.pdf")