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
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

Active tasks

Abstractly, the built-in active tasks consist of an instruction step (ORKInstructionStep), a get ready countdown step (ORKCountdownStep), task-specific step or steps, followed by a conclusion step (ORKCompletionStep). These tasks are instantiated following the same generic creation pattern employed by ResearchKit:

//  1
let task = ORKOrderedTask.fitnessCheckTaskWithIdentifier("FitnessTask",
            intendedUseDescription: "Blah, blah",walkDuration: 30.0,restDuration: 15.0,options: .None)
//  2
let taskViewController = ORKTaskViewController(task: task, taskRunUUID: nil)
//  3
taskViewController.delegate = self
//  4
let defaultFileManager = NSFileManager.defaultManager()
let documentDirectoryURL = defaultFileManager.URLsForDirectory(.DocumentDirectory, inDomains: .UserDomainMask)
taskViewController.outputDirectory = documentDirectoryURL.first!
//  5
presentViewController(taskViewController, animated: true, completion: nil)

The explanation of the above...

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