You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.1 KiB
Swift

//
// ConsentViewController.swift
// SAGE_RK_ML
//
// Created by Juan David Lopez Regalado on 31/01/25.
//
import UIKit
import ResearchKit
import ResearchKitUI
class ConsentViewController: UIViewController, ORKTaskViewControllerDelegate {
override func viewDidLoad() {
super.viewDidLoad()
self.navigationItem.hidesBackButton = false
// Do any additional setup after loading the view.
}
@IBAction func consentButton(_ sender: UIButton) {
let taskViewController = ORKTaskViewController(task: ConsentTask, taskRun: nil)
taskViewController.delegate = self
taskViewController.modalPresentationStyle = .fullScreen
present(taskViewController, animated: true, completion: nil)
}
func taskViewController(_ taskViewController: ORKTaskViewController, didFinishWith reason: ORKTaskFinishReason, error: (any Error)?) {
if let error = error {
print("Error en ResearchKit: \(error.localizedDescription)")
}
taskViewController.dismiss(animated: true, completion: nil)
}
}