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

5 months ago
//
// ViewController.swift
// surveys-example
//
// Created by Juan David López Regalado on 12/06/24.
//
import UIKit
import ResearchKit
5 months ago
import ResearchKitUI
5 months ago
5 months ago
class ViewController: UIViewController, ORKTaskViewControllerDelegate {
5 months ago
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
5 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)
5 months ago
5 months ago
}
func taskViewController(_ taskViewController: ORKTaskViewController, didFinishWith reason: ORKTaskFinishReason, error: (any Error)?) {
taskViewController.dismiss(animated: true, completion: nil)
}
5 months ago
}