Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Getting Started with ResearchKit

You're reading from   Getting Started with ResearchKit Enter the era of medical research using mobile devices with the help of this guide on ResearchKit!

Arrow left icon
Product type Paperback
Published in Feb 2016
Publisher
ISBN-13 9781785889172
Length 136 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
Dhanush Balachandran Dhanush Balachandran
Author Profile Icon Dhanush Balachandran
Dhanush Balachandran
Edward Cessna Edward Cessna
Author Profile Icon Edward Cessna
Edward Cessna
Arrow right icon
View More author details
Toc

Custom tasks


While navigable ordered tasks offer flexibility to skip steps, this may not be enough for more complex tasks. In such cases, ResearchKit allows you to build the custom tasks. Custom tasks can be built by creating objects that conform to the ORKTask protocol. These tasks provide the ultimate flexibility in dynamically choosing the next step based on the results from the previous steps. In the initial five ResearchKit apps that Apple announced, custom tasks were used to generate dynamic surveys based on the data received from the backend server and the answers provided by the users.

The ORKTask protocol has one non-optional property and two non-optional methods that need to be implemented in order to conform to this protocol. The ORKTaskViewController calls these methods on the custom task object to obtain relevant steps and dynamically present step view controllers to accomplish the step, as follows:

//1
public var identifier: String

//2
public func stepAfterStep(step: ORKStep...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image