1

I am developing an application in swift using research kit framework. When TaskViewController is loaded to display the questionnaire on click of cancel or done the following function is called:

func taskViewController(taskViewController: ORKTaskViewController, 
                     didFinishWithReason reason: ORKTaskViewControllerFinishReason, 
                     error: NSError?) 

Could anyone please help me to understand how to save the data each time when the application enters background. I tried calling didFinishWithReason function manually, but it didn't work.

l'L'l
  • 44,951
  • 10
  • 95
  • 146
Sonal0706
  • 290
  • 3
  • 15
  • Resolved. I just needed to make global object of the task view controller. And on entering background, if that object.result is accessed, the results can be fetched . :) – Sonal0706 Oct 25 '16 at 05:27

1 Answers1

0

Resolved. I just needed to make global object of the task view controller. And on entering background, if that object.result is accessed, the results can be fetched . :)

Sonal0706
  • 290
  • 3
  • 15