I've spent 24 hours trying to find a solution for this issue. When a user hits register on my app they will have to answer a series of survey questions (which I created using an ORKorderedtask (research kit)). Once the survey is completed I'd like the home page to be presented, however when I test the app and finish the survey it goes straight back to the register page. here's my code:
1.presenting the ordered task view controller;
let registrationTaskViewController = ORKTaskViewController(task: registrationSurvey, taskRun: nil)
registrationTaskViewController.delegate = self
self.present(registrationTaskViewController, animated: true, completion: nil)
2. Dismissing the task view controller(this doesn't work);
func taskViewController(_ taskViewController: ORKTaskViewController, didFinishWith reason: ORKTaskViewControllerFinishReason, error: Error?) {
self.dismiss(animated: false) {
let home = homePageViewController()
self.present(home, animated: true, completion: nil)
}
thanks in advance.