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.

36 lines
942 B
Swift

4 months ago
//
// ViewController.swift
// surveys-example
//
// Created by Juan David López Regalado on 12/06/24.
//
import UIKit
import ResearchKit
4 months ago
import ResearchKitUI
4 months ago
4 months ago
class ViewController: UIViewController, ORKTaskViewControllerDelegate {
4 months ago
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
4 months ago
@IBAction func startSurveyTapped(_ sender: Any) {
let consentTask = ConsentManager.shared.createConsentTask()
let taskViewController = ORKTaskViewController(task: consentTask, taskRun: nil)
taskViewController.delegate = self
present(taskViewController,animated: true, completion: nil)
4 months ago
4 months ago
}
func taskViewController(_ taskViewController: ORKTaskViewController, didFinishWith reason: ORKTaskFinishReason, error: (any Error)?) {
taskViewController.dismiss(animated: true, completion: nil)
}
4 months ago
}