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

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