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.